AsyncConcurrency
async/no-unbounded-concurrency
Promise aggregation over boundary-sized collections should use batching or a concurrency limit; fixed tuples are safe.
01 Examples
TypeScript
await Promise.all(req.body.urls.map(fetch));Finding
Disallow potentially unbounded promise fan-out.
02 Enable it
Setup
Install the package, register its plugin factory, then enable the rule.
Install the package
pnpm add -D @scruple/asyncRegister the plugin
In scruple.config.ts, register the factory under the async namespace used by the rule ID.
import { asyncRules } from "@scruple/async";
plugins: {
"async": asyncRules(),
},Enable the rule
"async/no-unbounded-concurrency": "warn"- Package
@scruple/async- Default threshold
- 0.9
- Minimum confidence
- 0.7