Open-source project
airbnb/javascript avatar
airbnb/javascript

Airbnb JavaScript Style Guide: A Rulebook That Ships as ESLint Config

GitHub describes it as JavaScript Style Guide. The repository metadata lists JavaScript as its primary language. The metadata lists the MIT license. This article stays within the project description and details documented in the GitHub repository README.

148,007 stars26,512 forksJavaScriptMIT

At a glance

What is it?
The Airbnb JavaScript Style Guide is a widely referenced set of ES2015+ coding conventions, published as a living document and packaged as eslint-config-airbnb. This review covers what it enforces, how to apply it, and where its assumptions may not fit your project.
Who is it for?
Adopt this guide if you want a detailed, opinionated ESLint setup for a modern JavaScript codebase, especially one that uses React and Babel. Do not adopt it if you prefer minimal linting, work in a non-Babel environment, or need to support browsers without native Symbol or BigInt support without polyfills.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 7 months ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • airbnb/javascript148,007 ★ · -141
Star history
Repository2026-08-132026-11-15
airbnb/javascript148.1k148k

-141 Stars in the last 94 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What This Guide Actually Is

The Airbnb JavaScript Style Guide is a set of written rules for writing JavaScript, organized into numbered sections from Types to Performance. It is not a tool itself. The value comes from the companion npm packages, eslint-config-airbnb and eslint-config-airbnb-base, which turn those rules into an ESLint configuration. The guide assumes you use Babel and require babel-preset-airbnb or equivalent, plus shims/polyfills via airbnb-browser-shims or equivalent. That assumption shapes everything else in the guide, and it is the first thing to check before you adopt it.

The Core Mechanism: Rules Paired with ESLint

Many rules in the guide are paired with an ESLint rule name. For example, rule 2.1 says 'Use const for all of your references; avoid using var' and points to prefer-const and no-const-assign. Rule 2.2 says use let instead of var when reassigning, pointing to no-var. Rule 3.1 says use literal syntax for object creation, pointing to no-new-object. This pairing means you do not have to memorize the guide. You run ESLint with the Airbnb config, and the linter flags violations. The README shows inline eslint comments, but the actual enforcement comes from the config package. The guide is the documentation for what the config enforces.

Getting It Running: Commands and Config Keys

The README links to the npm packages eslint-config-airbnb and eslint-config-airbnb-base through its badges. The repository has separate packages/eslint-config-airbnb and packages/eslint-config-airbnb-base directories. The guide also requires babel-preset-airbnb or equivalent, so your Babel setup must include that preset. The README states the guide assumes you are installing shims/polyfills, so you need airbnb-browser-shims or equivalent for older browsers.

What the Rules Prefer: const, let, and Object Shorthand

The guide is opinionated about modern syntax. It bans var entirely, requiring const for references that do not reassign and let for those that do. It explains that let and const are block-scoped while var is function-scoped, showing a code example where referencing a block-scoped variable throws a ReferenceError. For objects, it mandates literal syntax over new Object(), computed property names for dynamic keys, method shorthand, and property value shorthand. These rules are not surprising for ES2015+ code, but the guide enforces them consistently. The 'Why?' comments in the README give brief justifications, like avoiding reassignment bugs. This is a style guide that cares about reducing mutation and improving readability.

A Genuine Limitation: It Assumes Babel and Polyfills

The guide's note at the top is a hard constraint: it assumes Babel and requires babel-preset-airbnb or equivalent. It also assumes you install shims/polyfills. Rule 1.1 warns that Symbol and BigInt cannot be faithfully polyfilled, so they should not be used when targeting browsers that do not support them natively. That means if you are writing plain JavaScript without a build step, or if you need to support old browsers without polyfills, this guide will push you toward code that either breaks or requires extra setup. The guide is not wrong, but it is not universal. It is tailored to a modern, transpiled, polyfilled environment. If your project does not have that, the guide's rules may be more burden than help.

Where It Fits and Where It Does Not

The guide includes separate style guides for React and CSS-in-JavaScript, so it also covers React and CSS-in-JavaScript. The main guide covers general JavaScript, but the React companion adds component-specific rules. If you are not using React, you can use eslint-config-airbnb-base, which excludes React rules. The guide is a good fit for a team that wants a single, opinionated standard and is willing to adopt Babel and polyfills. It is a poor fit for a minimalist project that wants to avoid a build step or that targets environments where Symbol and BigInt are not available. The guide's assumptions are explicit, so you can decide early.

A Real Alternative: StandardJS

A common alternative is StandardJS, which is a zero-configuration JavaScript style guide. StandardJS does not require a build step or Babel preset. It enforces rules like no semicolons and uses its own ESLint config, but you do not need to install separate packages. The key difference is that StandardJS is opinionated about the tooling: it does not assume Babel or polyfills. The Airbnb guide is more flexible in some ways, since you can use eslint-config-airbnb-base without React, but it still assumes Babel. StandardJS is simpler to start with: you install standard and run it. The Airbnb guide gives you more granular control through ESLint rules, but that control comes with configuration overhead. Choose based on whether you want a preset that works out of the box or a configurable rulebook that assumes a modern toolchain.

Maintenance and License Considerations

The guide is licensed under MIT, which means you can use, modify, and distribute it freely, as long as you include the license. The repository is not archived and has a default branch of master. The guide is a living document with an Amendments section in the table of contents, so rules can change over time. That means your linting behavior may shift when you update eslint-config-airbnb, which could introduce new warnings or errors in your codebase. You should pin the version of the config package to control upgrades. The guide also has a Contributors section, indicating community involvement, but no release history is provided. The maintenance cost is ongoing: you need to track amendments and decide when to update your ESLint config.

Editorial conclusion

Adopt this guide if you want a detailed, opinionated ESLint setup for a modern JavaScript codebase, especially one that uses React and Babel. Do not adopt it if you prefer minimal linting, work in a non-Babel environment, or need to support browsers without native Symbol or BigInt support without polyfills. Before adopting, verify that your build pipeline includes babel-preset-airbnb or equivalent, and decide whether the guide's assumptions about polyfills match your target browsers. The guide is a living document under MIT license, so check the latest amendments for rule changes.

Frequently asked questions

How do I install the Airbnb JavaScript style guide as a linter?

The project publishes two npm packages, eslint-config-airbnb and eslint-config-airbnb-base, and both have their own directory under packages/ in the repository. Installing the repository root triggers a preinstall that runs npm prune and npm install inside each of those two packages.

Does the Airbnb JavaScript style guide require Babel?

The note at the top of the document says it assumes you are using Babel, requires babel-preset-airbnb or the equivalent, and assumes you install shims and polyfills with airbnb-browser-shims or the equivalent.

Which Airbnb style guide should I read, the ES5 one or the current one?

ES5 is marked Deprecated and lives on its own branch, while the current document is the one with the ECMAScript 6+ section, alongside separate React and CSS-in-JavaScript guides in the same repository. React and CSS & Sass also have their own guides, the latter in a different repository.

What does npm test check in the Airbnb style guide repository?

A pretest hook runs the lint script first, and that script is markdownlint configured by linters/.markdownlint.json, pointed at README.md and the README in each subdirectory. The test step then runs the tests of packages/eslint-config-airbnb and packages/eslint-config-airbnb-base in turn.

Official sources

  1. Official README
  2. Project repository
  3. README
  4. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/airbnb-javascript.svg)](https://hysenlabs.com/projects/airbnb-javascript)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/airbnb-javascript.svg)](https://hysenlabs.com/projects/airbnb-javascript)

Was this useful?