eslint-config-airbnb-base is Airbnb’s base ESLint shared config without any React-specific rules. It is the right choice for Node.js projects, libraries, CLIs, and any JavaScript codebase that does not use React.
Current version: 15.0.0
What it includes
Rule files bundled in the default export:| Rule file | Description |
|---|---|
best-practices | Error prevention, safe coding patterns |
errors | Possible JavaScript errors and misused APIs |
es6 | ES2015+ syntax rules |
imports | Module import ordering and resolution |
node | Node.js-specific globals and patterns |
strict | Strict mode directives |
style | Formatting, spacing, and naming conventions |
variables | Variable declaration and usage |
Peer dependencies
| Package | Required version |
|---|---|
eslint | ^7.32.0 || ^8.2.0 |
eslint-plugin-import | ^2.30.0 |
Entry points
Default (airbnb-base)
Targets ECMAScript 6 and later. This is the entry point for modern JavaScript projects.
.eslintrc.json
airbnb-base/legacy
Targets ES5 and below. Use this for projects that cannot use ES6+ syntax.
.eslintrc.json
airbnb-base/whitespace
Errors only on whitespace rules; all other rules become warnings. Useful for gradual adoption on large codebases.
.eslintrc.json
Node.js compatibility
Runtime dependencies
In addition to peer dependencies,eslint-config-airbnb-base depends on confusing-browser-globals to flag accidental usage of browser globals like event and status in non-browser code.
Configuration examples
Node.js project
.eslintrc.json
Override specific rules
.eslintrc.json
ES5 legacy project
.eslintrc.json
Monorepo with shared config
You can extendairbnb-base in a root config and override rules per package:
root .eslintrc.json
packages/api/.eslintrc.json