AsyncConcurrency
async/no-serial-independent-work
Independent operations that do not rely on ordering, shared state, transactions, locks, or rate limits should begin together.
01 Examples
TypeScript
const user = await getUser(id); const flags = await getFlags(id);Finding
Do not run independent awaits in series.
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-serial-independent-work": "warn"- Package
@scruple/async- Default threshold
- 0.9
- Minimum confidence
- 0.7