Skip to main content
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 fileDescription
best-practicesError prevention, safe coding patterns
errorsPossible JavaScript errors and misused APIs
es6ES2015+ syntax rules
importsModule import ordering and resolution
nodeNode.js-specific globals and patterns
strictStrict mode directives
styleFormatting, spacing, and naming conventions
variablesVariable declaration and usage

Peer dependencies

PackageRequired version
eslint^7.32.0 || ^8.2.0
eslint-plugin-import^2.30.0
Install all peer dependencies at once:
npx install-peerdeps --dev eslint-config-airbnb-base

Entry points

Default (airbnb-base)

Targets ECMAScript 6 and later. This is the entry point for modern JavaScript projects.
.eslintrc.json
{
  "extends": "airbnb-base"
}

airbnb-base/legacy

Targets ES5 and below. Use this for projects that cannot use ES6+ syntax.
.eslintrc.json
{
  "extends": "airbnb-base/legacy"
}

airbnb-base/whitespace

Errors only on whitespace rules; all other rules become warnings. Useful for gradual adoption on large codebases.
.eslintrc.json
{
  "extends": "airbnb-base/whitespace"
}

Node.js compatibility

^10.12.0 || >=12.0.0

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
{
  "extends": "airbnb-base",
  "env": {
    "node": true
  }
}

Override specific rules

.eslintrc.json
{
  "extends": "airbnb-base",
  "rules": {
    "no-console": "off",
    "import/prefer-default-export": "off",
    "no-param-reassign": "warn"
  }
}

ES5 legacy project

.eslintrc.json
{
  "extends": "airbnb-base/legacy",
  "env": {
    "browser": true,
    "jquery": true
  }
}

Monorepo with shared config

You can extend airbnb-base in a root config and override rules per package:
root .eslintrc.json
{
  "extends": "airbnb-base",
  "root": true
}
packages/api/.eslintrc.json
{
  "extends": "../../.eslintrc.json",
  "env": {
    "node": true
  },
  "rules": {
    "no-console": "off"
  }
}

Build docs developers (and LLMs) love