eslint-config-airbnb, eslint-config-google, and eslint-config-standard are shared configuration packages for ESLint that enforce specific coding styles and best practices. eslint-config-airbnb is known for its comprehensive rule set tailored for React applications, including strict accessibility and import order checks. eslint-config-google implements the Google JavaScript Style Guide, focusing on readability and simplicity with fewer dependencies. eslint-config-standard promotes a no-configuration approach, enforcing a specific style automatically without requiring an ESLint config file.
Choosing the right ESLint configuration is a critical architectural decision that impacts code consistency, developer onboarding, and long-term maintenance. eslint-config-airbnb, eslint-config-google, and eslint-config-standard represent three distinct philosophies on how JavaScript code should look and behave. Let's break down how they handle setup, framework support, and rule enforcement.
eslint-config-airbnb requires a significant number of peer dependencies to function correctly.
// .eslintrc.json for Airbnb
{
"extends": ["airbnb", "airbnb/hooks"],
"plugins": ["react", "jsx-a11y", "import"]
}
eslint-config-google has a lighter dependency tree.
eslint-plugin-import.// .eslintrc.json for Google
{
"extends": ["google"],
"plugins": ["import"]
}
eslint-config-standard aims for zero configuration.
standard CLI tool instead of ESLint directly.eslint-plugin-promise.// .eslintrc.json for Standard
{
"extends": ["standard"],
"plugins": ["promise", "node"]
}
eslint-config-airbnb is built specifically for React development.
// Airbnb: Enforces alt text on images
// <img src="logo.png" /> ❌ Error: Missing alt prop
<img src="logo.png" alt="Company Logo" /> ✅ Pass
eslint-config-google treats React as standard JavaScript.
// Google: No specific React JSX rules by default
// <img src="logo.png" /> ✅ Passes (unless custom rules added)
<img src="logo.png" alt="Company Logo" /> ✅ Pass
eslint-config-standard focuses on general JavaScript style.
// Standard: Focuses on JS syntax, not JSX semantics
// <img src="logo.png" /> ✅ Passes standard JS checks
<img src="logo.png" alt="Company Logo" /> ✅ Pass
eslint-config-airbnb offers an official TypeScript variant.
eslint-config-airbnb-typescript for full support.// Airbnb TypeScript setup
{
"extends": ["airbnb-typescript"]
}
eslint-config-google lacks an official TypeScript configuration.
// Google TypeScript setup (Community maintained)
{
"extends": ["google", "plugin:@typescript-eslint/recommended"]
}
eslint-config-standard provides a dedicated TypeScript package.
eslint-config-standard-with-typescript for proper integration.// Standard TypeScript setup
{
"extends": ["standard-with-typescript"]
}
eslint-config-airbnb prioritizes safety and consistency.
// Airbnb: Disallows unused variables
const unused = 1; ❌ Error: 'unused' is assigned a value but never used
eslint-config-google prioritizes human readability.
// Google: Requires semicolons
const value = 1 ❌ Error: Missing semicolon
const value = 1; ✅ Pass
eslint-config-standard prioritizes developer comfort.
// Standard: Omits semicolons
const value = 1 ✅ Pass
const value = 1; ❌ Error: Extra semicolon
| Feature | eslint-config-airbnb | eslint-config-google | eslint-config-standard |
|---|---|---|---|
| Primary Focus | React & Safety | Readability & Simplicity | Zero Config & Speed |
| Setup Effort | High (Many deps) | Low (Few deps) | None (CLI preferred) |
| React Support | ✅ Extensive | ⚠️ Minimal | ⚠️ Minimal |
| TypeScript | ✅ Official Config | ❌ Community Only | ✅ Official Config |
| Semicolons | ✅ Required | ✅ Required | ❌ Omitted |
| Quotes | Single | Single | Single |
eslint-config-airbnb is the enterprise choice 🏢 — best for large React teams that need strict guardrails and accessibility enforcement. It requires more setup but pays off in code safety.
eslint-config-google is the minimalist choice 📄 — ideal for libraries or teams that want a clean, readable style without React-specific overhead. It is stable but less feature-rich for modern frameworks.
eslint-config-standard is the speed choice 🏎️ — perfect for small teams or prototypes that want to skip configuration entirely. Consider using the standard CLI tool for the best experience.
Final Thought: All three tools aim to reduce debate about code style. Your choice should depend on your framework needs and how much control you want over the rules.
Choose eslint-config-airbnb if you are building React applications and want a battle-tested, strict rule set that covers accessibility and import hygiene. It is ideal for teams that prefer explicit configuration and need strong community support for modern JavaScript features. Be prepared to install several peer dependencies to satisfy its requirements.
Choose eslint-config-standard if you want to avoid maintaining an ESLint configuration file entirely. It is perfect for teams that agree on the Standard style rules and want to focus on logic rather than style debates. Note that using the standard CLI tool is often recommended over installing the config package directly.
Choose eslint-config-google if your team values simplicity and aligns with the Google JavaScript Style Guide. It works well for projects that want clear, readable code without the heavy overhead of React-specific rules. This option is suitable for libraries or backend services where minimal configuration is preferred.
This package provides Airbnb's .eslintrc as an extensible shared config.
We export three ESLint configurations for your usage.
Our default export contains most of our ESLint rules, including ECMAScript 6+ and React. It requires eslint, eslint-plugin-import, eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-jsx-a11y. Note that it does not enable our React Hooks rules. To enable those, see the eslint-config-airbnb/hooks section.
If you don't need React, see eslint-config-airbnb-base.
npm info "eslint-config-airbnb@latest" peerDependencies
If using npm 5+, use this shortcut
npx install-peerdeps --dev eslint-config-airbnb
If using yarn, you can also use the shortcut described above if you have npm 5+ installed on your machine, as the command will detect that you are using yarn and will act accordingly.
Otherwise, run npm info "eslint-config-airbnb@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<version> for each listed peer dependency.
If using npm < 5, Linux/OSX users can run
(
export PKG=eslint-config-airbnb;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)
Which produces and runs a command like:
npm install --save-dev eslint-config-airbnb eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.# eslint-plugin-react-hooks@^#.#.#
If using npm < 5, Windows users can either install all the peer dependencies manually, or use the install-peerdeps cli tool.
npm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb
The cli will produce and run a command like:
npm install --save-dev eslint-config-airbnb eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.# eslint-plugin-react-hooks@^#.#.#
"extends": "airbnb" to your .eslintrcThis entry point enables the linting rules for React hooks (requires v16.8+). To use, add "extends": ["airbnb", "airbnb/hooks"] to your .eslintrc.
This entry point only errors on whitespace rules and sets all other rules to warnings. View the list of whitespace rules here.
This entry point is deprecated. See eslint-config-airbnb-base.
This entry point is deprecated. See eslint-config-airbnb-base.
See Airbnb's JavaScript styleguide and the ESlint config docs for more information.
Consider adding test cases if you're making complicated rules changes, like anything involving regexes. Perhaps in a distant future, we could use literate programming to structure our README as test cases for our .eslintrc?
You can run tests with npm test.
You can make sure this module lints with itself using npm run lint.