Option 1: Read the guide
Browse the rule categories in the sidebar. Each section covers a specific area of JavaScript with concrete examples of preferred and discouraged patterns, along with the reasoning behind each convention. Start with these sections if you’re new to the guide:- Types and references —
const,let, and how JavaScript types behave - Functions — default parameters, arrow functions, and avoiding common pitfalls
- Naming conventions — consistent casing and naming patterns across your codebase
Option 2: Enforce with ESLint
Installing the ESLint config is the most reliable way to adopt the style guide. Rules are checked automatically on every file save or CI run, so conventions are enforced consistently without relying on code review to catch everything. Choose the package that matches your project:eslint-config-airbnb
For React projects. Includes ECMAScript 6+ rules plus React, JSX, hooks, and accessibility rules.
eslint-config-airbnb-base
For non-React projects. Includes ECMAScript 6+ rules without any React plugins.
Install eslint-config-airbnb (with React)
Install the package and peer dependencies
The config requires several peer dependencies. The easiest way to install everything at once is with This installs
install-peerdeps:eslint-config-airbnb along with eslint, eslint-plugin-import, eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-jsx-a11y.Add the config to your .eslintrc
Create or update your To also enable React Hooks rules, extend both configs:
.eslintrc file to extend the Airbnb config:.eslintrc
.eslintrc
Install eslint-config-airbnb-base (without React)
Install the package and peer dependencies
eslint-config-airbnb-base along with eslint and eslint-plugin-import.Adopting incrementally
If you’re adding the style guide to an existing codebase, enforcing every rule immediately can generate a large number of violations. A few approaches for a smoother rollout: Start with whitespace only. Both packages ship a/whitespace entry point that errors only on whitespace rules and downgrades all other rules to warnings:
.eslintrc
--fix to auto-correct. Many style violations can be fixed automatically:
.eslintrc to turn them off while you work toward full adoption:
.eslintrc
To verify which peer dependency versions are required for your installed version of the config, run:or for the base config:
Next steps
Types and references
Start with the foundational rules around types,
const, and let.ESLint config reference
Learn about all available entry points and configuration options.