Registry / testing / eslint-config-async

eslint-config-async

JSON →
library3.1.0jsnpmunverified

A shareable ESLint config (v3.1.0) for writing better asynchronous JavaScript and TypeScript code. It provides a curated set of rules to avoid common async pitfalls (e.g., unhandled promises, missing await, improper error handling) based on the author's article. Requires ESLint v9 and Node.js ^18.18.0 || ^20.9.0 || >=21.1.0. Key differentiators: focused solely on async patterns, built-in TypeScript support via typescript-eslint, and flat config only (no .eslintrc support in v3).

npm install eslint-config-async
INSTALL
IMPORT
SIG · ESLINT-CONFIG-ASYN
E
eslint-config-async
testingjavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

base
const asyncConfig = require('eslint-config-async'); module.exports = [ ...asyncConfig.base ];
module.exports = { extends: ['async'] }
v3 uses flat config only; array spread required. For ESM, use import asyncConfig from 'eslint-config-async'.
node
const asyncConfig = require('eslint-config-async'); module.exports = [ ...asyncConfig.node ];
module.exports = { extends: ['async/node'] }
Node-specific rules are recommended for server-side code.
typescript
const asyncConfig = require('eslint-config-async'); module.exports = [ ...asyncConfig.typescript ];
module.exports = { extends: ['async/typescript'] }
Requires typescript-eslint config to be applied first (e.g., tseslint.configs.base).

Sets up ESLint with async base and Node rules using flat config. Assumes ESLint v9 is installed.

// eslint.config.js const asyncConfig = require('eslint-config-async'); module.exports = [ ...asyncConfig.base, ...asyncConfig.node, { rules: { 'no-console': 'warn', }, }, ];
Debug
Known issues
breakingv3 requires ESLint v9 and flat config (.eslintrc.* not supported).
fix
Migrate to eslint.config.js and use the array-based flat config syntax shown in the README.
affects: >=3.0.0
breakingv3 replaces eslint-config-node (unmaintained) with eslint-config-n and moves it from peer to direct dependency.
fix
Remove eslint-plugin-node from devDependencies; eslint-config-async now includes eslint-plugin-n.
affects: >=3.0.0
breakingv3 merges multiple config files into a single file with named exports; old extends patterns fail.
fix
Use named exports: asyncConfig.base, asyncConfig.node, asyncConfig.typescript.
affects: >=3.0.0
breakingv2 to v3: typescript-eslint v8 replaces @typescript-eslint/parser and @typescript-eslint/eslint-plugin.
fix
Install typescript-eslint and use tseslint.configs.base instead of parser/plugin.
affects: >=3.0.0
gotchaNon-TypeScript users must not use asyncConfig.typescript; it will cause errors without typescript-eslint.
fix
Only spread asyncConfig.typescript if you have TypeScript and typescript-eslint installed.
affects: >=2.0.0
gotchaTypeScript users must apply a tseslint config (e.g., tseslint.configs.base) before asyncConfig.typescript.
fix
Include tseslint.configs.base in the config array before asyncConfig.typescript.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-config-async'
Package not installed or incorrect import path.
fix
Run: npm install --save-dev eslint-config-async
Require of ES Module eslint-config-async not supported.
Using require() in an ESM project or wrong config file extension.
fix
Use import asyncConfig from 'eslint-config-async' or rename file to .cjs.
Configuration for rule 'no-return-await' is invalid: Value 'error' is the wrong type.
Using an old eslint-config-async version with ESLint v9 which removed the rule.
fix
Upgrade to eslint-config-async@3.1.0 which removed 'no-return-await'.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; v9^ required by v3.
typescriptoptionalOptional peer dependency; required only for TypeScript users.
typescript-eslintoptionalPeer dependency; v8^ required for TypeScript configs.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-config-async — npm install eslint-config-async · libregistry