AsyncConcurrency
async/require-race-loser-cleanup
Locally created branches that lose Promise.race or Promise.any need cancellation, settlement observation, or cleanup.
01 Examples
TypeScript
await Promise.race([fetch(url), delay(1000)]);Finding
Require cleanup of locally owned race losers.
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/require-race-loser-cleanup": "warn"- Package
@scruple/async- Default threshold
- Plugin default
- Minimum confidence
- Plugin default