AsyncAsync lifecycle
async/no-unobserved-async-work
Promise-producing calls should be awaited, returned, chained, aggregated, or explicitly marked as deliberate fire-and-forget work.
01 Examples
TypeScript
function save() { persist(); }Finding
Do not leave started async work unobserved.
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-unobserved-async-work": "warn"- Package
@scruple/async- Default threshold
- Plugin default
- Minimum confidence
- Plugin default