Airbnb ESLint Config

raw JSON →
19.0.4 verified Sat Apr 25 auth: no javascript

eslint-config-airbnb provides a widely-used ESLint shareable config that enforces Airbnb's JavaScript style guide, including ECMAScript 6+ and React rules. The current version is 19.0.4, requiring eslint ^7.32.0 || ^8.2.0 with peer dependencies for React plugins, import plugin, and JSX accessibility plugin. It is one of the most popular ESLint configs, offering a comprehensive set of opinionated rules. Released under the MIT license, it has a stable release cadence and is actively maintained on GitHub.

error Error: Failed to load plugin 'import'
cause eslint-plugin-import is not installed or version incompatible
fix
Install the correct version: npm info 'eslint-config-airbnb@latest' peerDependencies
error Error: Failed to load plugin 'react'
cause eslint-plugin-react is not installed
fix
Install eslint-plugin-react as a dev dependency
error Error: Cannot find module 'eslint-config-airbnb'
cause Config name is misspelled or package not installed
fix
Ensure package is installed and use 'airbnb' (not full name) in extends
breaking v19 requires eslint ^7.32.0 || ^8.2.0, dropping support for ESLint <7
fix Upgrade ESLint to version 7.32.0 or 8.2.0+
deprecated eslint-config-airbnb/base and eslint-config-airbnb/legacy are deprecated; use eslint-config-airbnb-base
fix Replace with eslint-config-airbnb-base package
gotcha Auto-installing peer dependencies incorrectly may cause version mismatches
fix Use official install command: npx install-peerdeps --dev eslint-config-airbnb
npm install eslint-config-airbnb
yarn add eslint-config-airbnb
pnpm add eslint-config-airbnb

Shows how to install eslint-config-airbnb with peer dependencies and configure it in .eslintrc.

// Install with peer dependencies
npx install-peerdeps --dev eslint-config-airbnb

// Then add to .eslintrc.json
{
  "extends": "airbnb"
}

// Or for React Hooks support
{
  "extends": ["airbnb", "airbnb/hooks"]
}