Skip to content
← All rules
AsyncConcurrency

async/no-unbounded-concurrency

Promise aggregation over boundary-sized collections should use batching or a concurrency limit; fixed tuples are safe.

promiseslimitsfan-out
TypeScript
await Promise.all(req.body.urls.map(fetch));
Finding

Disallow potentially unbounded promise fan-out.

Setup

Install the package, register its plugin factory, then enable the rule.

Install the package

pnpm add -D @scruple/async

Register 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

Released under the MIT License.