eslint-config-airbnb vs eslint-config-standard vs eslint-config-xo
Enforcing Code Quality and Style in JavaScript Projects
eslint-config-airbnbeslint-config-standardeslint-config-xoSimilar Packages:

Enforcing Code Quality and Style in JavaScript Projects

eslint-config-airbnb, eslint-config-standard, and eslint-config-xo are shared configuration packages for ESLint that enforce specific coding styles and best practices. They save teams from writing hundreds of rules manually by providing a ready-made setup. eslint-config-airbnb is known for strictness and React support. eslint-config-standard focuses on simplicity and no configuration files. eslint-config-xo offers a modern, sensible default setup often used with the XO CLI tool.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
eslint-config-airbnb0148,04681.7 kB170-MIT
eslint-config-standard02,64416.1 kB293 years agoMIT
eslint-config-xo0286104 kB33 days agoMIT

ESLint Config Showdown: Airbnb vs Standard vs XO

When setting up linting for a JavaScript project, writing hundreds of rules from scratch is rarely efficient. Shared configs like eslint-config-airbnb, eslint-config-standard, and eslint-config-xo provide pre-built rule sets that enforce style and catch errors. Each takes a different approach to strictness, setup, and philosophy. Let's compare how they handle real-world engineering needs.

πŸ› οΈ Installation & Setup: Heavy Lift vs Zero Config

eslint-config-airbnb requires installing many peer dependencies to work correctly.

  • You must install ESLint plus specific plugins for React and JSX.
  • This ensures all rules have the tools they need to run.
# airbnb: Install core + peers
npm install -D eslint eslint-config-airbnb eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y

eslint-config-standard aims for zero configuration files.

  • You install the config and ESLint.
  • It often pairs with the standard CLI which hides the config file entirely.
# standard: Minimal install
npm install -D eslint eslint-config-standard eslint-plugin-promise eslint-plugin-n eslint-plugin-import

eslint-config-xo keeps dependencies lighter than Airbnb.

  • You install the config and ESLint.
  • It is often used via the xo CLI tool which bundles this config.
# xo: Moderate install
npm install -D eslint eslint-config-xo

πŸ“ Rule Strictness: Enterprise Rigor vs Sensible Defaults

eslint-config-airbnb is extremely strict out of the box.

  • It forbids unused variables, missing prop types, and specific styling choices.
  • Great for teams that want to avoid code review debates.
// .eslintrc.js for airbnb
module.exports = {
  extends: ['airbnb'],
  rules: {
    // Often need to relax rules for practical use
    'no-console': 'warn',
    'react/prop-types': 'off'
  }
};

eslint-config-standard enforces a specific style opinion.

  • No semicolons, single quotes, and 2-space indentation are mandatory.
  • Less focus on React specifics, more on core JavaScript style.
// .eslintrc.js for standard
module.exports = {
  extends: ['standard'],
  rules: {
    // Hard to change core style opinions
    'semi': ['error', 'never'],
    'quotes': ['error', 'single']
  }
};

eslint-config-xo balances strictness with modern syntax.

  • It allows semicolons and focuses on correctness over style wars.
  • Good for libraries that want safety without forcing a specific look.
// .eslintrc.js for xo
module.exports = {
  extends: ['xo'],
  rules: {
    // Easier to override specific preferences
    'semicolon': ['error', 'always'],
    'space-before-function-paren': 'error'
  }
};

βš›οΈ React & JSX Support: Built-In vs Add-On

eslint-config-airbnb has first-class React support built in.

  • It includes rules for hooks, accessibility, and prop validation.
  • You do not need to search for extra plugins to lint React code.
// airbnb: React rules active by default
// This triggers an error if hooks are used incorrectly
function Component() {
  const [val, setVal] = useState(); // Error: missing dependency array
}

eslint-config-standard treats React as an add-on.

  • You need eslint-config-standard-react to get JSX support.
  • Core config focuses on vanilla JavaScript logic.
// standard: Requires extra config for React
module.exports = {
  extends: ['standard', 'standard-react']
};

eslint-config-xo supports React via a separate preset.

  • You extend xo-react to get JSX rules.
  • Keeps the core config clean for non-React projects.
// xo: React preset available
module.exports = {
  extends: ['xo', 'xo-react']
};

πŸ”Œ Extensibility: Overriding Rules

eslint-config-airbnb allows overrides but fights you on style.

  • You can turn rules off, but the base config is very opinionated.
  • Best used when you agree with 90% of the rules already.
// airbnb: Overriding strict rules
module.exports = {
  extends: ['airbnb'],
  rules: {
    'max-len': ['error', { code: 120 }] // Relax line length
  }
};

eslint-config-standard is harder to tweak on style.

  • The philosophy is "no config" so changing style defeats the purpose.
  • Best for teams that accept the Standard style fully.
// standard: Overriding style (goes against grain)
module.exports = {
  extends: ['standard'],
  rules: {
    'semi': ['error', 'always'] // Conflicts with core philosophy
  }
};

eslint-config-xo is designed to be extended easily.

  • It expects you to tweak rules to fit your project needs.
  • Good middle ground between rigid and loose.
// xo: Clean overrides
module.exports = {
  extends: ['xo'],
  rules: {
    'no-unused-vars': 'warn' // Adjust severity easily
  }
};

πŸ“Š Summary: Key Differences

Featureeslint-config-airbnbeslint-config-standardeslint-config-xo
Setup Effort🐘 High (many peers)🐦 Low (zero config)πŸ• Medium (simple)
StrictnessπŸ”’ Very HighπŸ›‘ High (Style focused)βš–οΈ Moderate
React Supportβœ… Built-inβž• Add-on requiredβž• Add-on required
Semicolonsβœ… Required❌ Forbiddenβœ… Required
Best ForEnterprise React AppsQuick Scripts / OSSModern Libraries

πŸ’‘ The Big Picture

eslint-config-airbnb is the heavy-duty option πŸ‹οΈ. It brings everything you need for a large React codebase but requires maintenance of peer dependencies. Use this when consistency matters more than setup speed.

eslint-config-standard is the opinionated shortcut ⚑. It removes decision fatigue by enforcing a specific look (no semicolons). Use this for small teams or projects where you want to stop talking about style and start coding.

eslint-config-xo is the modern balanced choice βš–οΈ. It provides safety and cleanliness without forcing extreme style rules. Use this for libraries or teams that want solid defaults with room to breathe.

Final Thought: All three tools solve the same problem β€” keeping code clean β€” but they differ in how much control they take away from you. Pick the one that matches your team's tolerance for rules.

How to Choose: eslint-config-airbnb vs eslint-config-standard vs eslint-config-xo

  • eslint-config-airbnb:

    Choose eslint-config-airbnb if you work on large React teams that need strict consistency and accessibility rules. It requires more setup because of many peer dependencies, but it prevents common bugs in production. This is the best fit for enterprise applications where code uniformity is critical.

  • eslint-config-standard:

    Choose eslint-config-standard if you want to start quickly without managing configuration files. It enforces a semicolon-free style automatically and works well for small teams or open-source projects. Avoid this if your team strongly prefers semicolons or needs heavy customization.

  • eslint-config-xo:

    Choose eslint-config-xo if you want modern JavaScript defaults without extreme strictness. It works well for libraries and apps that use TypeScript or modern ES features. This is ideal for developers who want a clean setup without the heavy weight of the Airbnb config.

README for eslint-config-airbnb

eslint-config-airbnb

npm version

This package provides Airbnb's .eslintrc as an extensible shared config.

Usage

We export three ESLint configurations for your usage.

eslint-config-airbnb

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.

  1. Install the correct versions of each package, which are listed by the command:
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@^#.#.#
  1. Add "extends": "airbnb" to your .eslintrc

eslint-config-airbnb/hooks

This entry point enables the linting rules for React hooks (requires v16.8+). To use, add "extends": ["airbnb", "airbnb/hooks"] to your .eslintrc.

eslint-config-airbnb/whitespace

This entry point only errors on whitespace rules and sets all other rules to warnings. View the list of whitespace rules here.

eslint-config-airbnb/base

This entry point is deprecated. See eslint-config-airbnb-base.

eslint-config-airbnb/legacy

This entry point is deprecated. See eslint-config-airbnb-base.

See Airbnb's JavaScript styleguide and the ESlint config docs for more information.

Improving this config

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.