@noctcore/eslint-plugin-async-safety
A bad fit for browser-only code that relies on the platform's own fetch lifetime, and for scripts where hanging is harmless.
Async correctness TypeScript cannot catch: unbounded fetch, dropped AbortSignals, concurrency races.
What it solves
Section titled “What it solves”An async bug usually type-checks. A fetch with no timeout hangs a worker forever, a function that accepts an AbortSignal and never forwards it cannot be cancelled, two iterations of a Promise.all(arr.map(async ...)) read and write the same counter and lose an update, a module-level variable written in a request handler leaks between requests.
What it will yell at you about
Section titled “What it will yell at you about”It will yell at you about timeouts and cancellation first: require-fetch-timeout fires on every bare fetch, which is intentional and noisy on first run. no-shared-mutable-module-state and require-client-timeout ship enabled but inert until you tell them which files are server code and which clients to check. Timeouts and parallelism change runtime behaviour, so the fixes are editor suggestions, never autofixes. prefer-parallel-awaits ships off: sequential awaits are often deliberate. It is a bad fit for browser-only code that relies on the platform’s own fetch lifetime, and for scripts where hanging is harmless.
Install and configure
Section titled “Install and configure”npm install --save-dev @noctcore/eslint-plugin-async-safety @typescript-eslint/parser# or: bun add -D / pnpm add -D @noctcore/eslint-plugin-async-safety @typescript-eslint/parserThe recommended preset enables 4 of 7 rules. The rules board below builds the flat config: start from a preset, switch single rules between error and off, and copy the result.
Each rule links to its page, with the options it takes and Incorrect and Correct examples. A good first
read is forward-abort-signal.
--fixsuggestionsneeds optionstype infoEach switch sets a rule to error or off.
AbortSignal (param named signal or typed AbortSignal) but awaits a call without ever forwarding it leaves that work uncancellable.Promise.all(arr.map(async …)) callback, can lose updates.setTimeout timeout raced with Promise.race must be cleared — otherwise the timer outlives the race whenever the other promise wins.include.const x = await read() statements can run concurrently via await Promise.all([...]).fetch (or configured wrapper) call must carry a signal/timeout in its options — an unbounded request can hang forever.