Skip to content
← All rules
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.

promiseserrorsfire-and-forget
TypeScript
function save() { persist(); }
Finding

Do not leave started async work unobserved.

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-unobserved-async-work": "warn"
Package
@scruple/async
Default threshold
Plugin default
Minimum confidence
Plugin default

Released under the MIT License.