Skip to main content
eslint-config-airbnb is Airbnb’s full ESLint shared config. It extends eslint-config-airbnb-base with additional rules for React, JSX accessibility, and React Hooks. Current version: 19.0.4

What it includes

  • All rules from eslint-config-airbnb-base (best practices, style, imports, ES6, variables, errors, strict, Node)
  • React component and JSX rules via eslint-plugin-react
  • Accessibility rules for JSX via eslint-plugin-jsx-a11y
  • React Hooks rules via eslint-plugin-react-hooks (opt-in via /hooks entry point)

Peer dependencies

The following packages must be installed alongside eslint-config-airbnb:
PackageRequired version
eslint^7.32.0 || ^8.2.0
eslint-plugin-import^2.30.0
eslint-plugin-jsx-a11y^6.10.0
eslint-plugin-react^7.36.1
eslint-plugin-react-hooks^5.1.0
Install all peer dependencies at once:
npx install-peerdeps --dev eslint-config-airbnb

Entry points

Default (airbnb)

The main entry point includes all base JavaScript rules plus React, JSX, and accessibility rules. React Hooks rules are not enabled by default.
.eslintrc.json
{
  "extends": "airbnb"
}

airbnb/hooks

Adds linting rules for the React Hooks API (eslint-plugin-react-hooks). Requires React 16.8+.
.eslintrc.json
{
  "extends": ["airbnb", "airbnb/hooks"]
}
Rules enabled by this entry point:
  • react-hooks/rules-of-hooks — error
  • react-hooks/exhaustive-deps — error

airbnb/whitespace

Errors only on whitespace rules; all other rules become warnings. Useful when gradually adopting the config on an existing codebase.
.eslintrc.json
{
  "extends": "airbnb/whitespace"
}

airbnb/base and airbnb/legacy (deprecated)

Both airbnb/base and airbnb/legacy are deprecated entry points. Use eslint-config-airbnb-base directly instead.

Node.js compatibility

^10.12.0 || ^12.22.0 || ^14.17.0 || >=16.0.0

Configuration examples

Minimal React setup

.eslintrc.json
{
  "extends": "airbnb"
}

React with Hooks rules

.eslintrc.json
{
  "extends": ["airbnb", "airbnb/hooks"]
}

Override specific rules

.eslintrc.json
{
  "extends": ["airbnb", "airbnb/hooks"],
  "rules": {
    "react/react-in-jsx-scope": "off",
    "react/prop-types": "warn",
    "jsx-a11y/anchor-is-valid": "warn"
  }
}
If you are using React 17+ with the new JSX transform, you can safely disable react/react-in-jsx-scope since you no longer need to import React in every file that uses JSX.

Allow .tsx and .ts file extensions

By default, only .jsx files may contain JSX. To allow TypeScript files:
.eslintrc.json
{
  "extends": ["airbnb", "airbnb/hooks"],
  "rules": {
    "react/jsx-filename-extension": ["error", { "extensions": [".jsx", ".tsx"] }]
  }
}

Build docs developers (and LLMs) love