Skip to main content
The Airbnb JavaScript Style Guide is a set of standards for writing JavaScript that has become one of the most widely adopted style guides in the industry. Its philosophy is captured in the tagline: a mostly reasonable approach to JavaScript. The guide doesn’t aim for perfection or absolute consistency at all costs. Instead, it captures practical conventions that make code easier to read, reason about, and maintain across large teams and long-lived codebases.

Philosophy

Every rule in the guide exists for a reason. Where it matters, each convention is accompanied by an explanation of why — not just what. This helps you understand the intent, so you can apply good judgment when edge cases arise. The guide takes a strong stance on ES6+ features. Modern JavaScript syntax — destructuring, arrow functions, template literals, const/let, modules — is not just permitted, it’s preferred. The goal is idiomatic, modern JavaScript.
This guide assumes you are using Babel and requires babel-preset-airbnb or the equivalent. It also assumes you are installing shims/polyfills in your app, with airbnb-browser-shims or the equivalent.

What’s covered

The style guide is organized into rule categories that span the full JavaScript language surface:

Types and references

Primitive vs. complex types, const over var, and when to use let.

Objects and arrays

Object shorthand, computed property names, spread syntax, and array destructuring.

Functions

Default parameters, rest syntax, arrow functions, and avoiding the arguments object.

Classes and modules

ES6 class syntax, import/export conventions, and module organization.

Naming conventions

camelCase, PascalCase, SCREAMING_SNAKE_CASE — when to use each, and why.

Formatting

Whitespace, semicolons, commas, and consistent code structure.

ESLint packages

Reading the guide is one way to adopt these conventions. Enforcing them automatically is another. Airbnb publishes two ESLint configs that encode the rules from this guide directly into your linting pipeline: Both packages are available on npm and are installed alongside their peer dependencies.

Other style guides

This JavaScript guide is part of a broader family of Airbnb style guides:

React / JSX

Style conventions for React components, JSX syntax, props, state, and hooks.

CSS-in-JavaScript

Conventions for styling components with CSS-in-JS libraries.
Airbnb also maintains style guides for CSS & Sass and Ruby, hosted separately on GitHub.

Build docs developers (and LLMs) love