javascript README

The project's README from github.com/airbnb/javascript. As one markdown file: README.md.

Airbnb JavaScript Style Guide() {

A mostly reasonable approach to JavaScript

Note: this guide assumes you are using Babel, and requires that you use babel-preset-airbnb or the equivalent. It also assumes you are installing shims/polyfills in your app, with airbnb-browser-shims or the equivalent.

Downloads Downloads Gitter

This guide is available in other languages too. See Translation

Other Style Guides

Table of Contents

  1. Types
  2. References
  3. Objects
  4. Arrays
  5. Destructuring
  6. Strings
  7. Functions
  8. Arrow Functions
  9. Classes & Constructors
  10. Modules
  11. Iterators and Generators
  12. Properties
  13. Variables
  14. Hoisting
  15. Comparison Operators & Equality
  16. Blocks
  17. Control Statements
  18. Comments
  19. Whitespace
  20. Commas
  21. Semicolons
  22. Type Casting & Coercion
  23. Naming Conventions
  24. Accessors
  25. Events
  26. jQuery
  27. ECMAScript 5 Compatibility
  28. ECMAScript 6+ (ES 2015+) Styles
  29. Standard Library
  30. Testing
  31. Performance
  32. Resources
  33. In the Wild
  34. Translation
  35. The JavaScript Style Guide Guide
  36. Chat With Us About JavaScript
  37. Contributors
  38. License
  39. Amendments

Types

⬆ back to top

References

⬆ back to top

Objects

⬆ back to top

Arrays

⬆ back to top

Destructuring

⬆ back to top

Strings

javascript (airbnb/javascript)

naming-conventions
Searching Database…

148.1K ·GitHub
What is this?A JavaScript style guide from Airbnb covering conventions for types, variables, functions, classes, modules, naming, whitespace, and more, described as 'a mostly reasonable approach to JavaScript'.
Is this a linter or just a document?It is primarily a set of documented coding conventions (a style guide), not an executable tool itself, though most rules reference the matching ESLint rule so you can enforce them automatically.
How do I actually apply these rules to my project?Install the companion ESLint configs (eslint-config-airbnb for React projects or eslint-config-airbnb-base for plain JS) from this monorepo's packages, and set up Babel with babel-preset-airbnb plus airbnb-browser-shims for polyfills.
Do I need Babel to follow this guide?Yes, the guide assumes you use Babel (via babel-preset-airbnb) and polyfills via airbnb-browser-shims for ES6+ features to work consistently across environments.
Does it cover every flavor of JavaScript, like React or CSS-in-JS?No, this repo is just the core JS guide; separate linked guides exist for React, CSS-in-JavaScript, CSS & Sass, and a deprecated ES5 guide.
How is the guide organized?It's structured as a long table of contents with numbered sections like Types, References, Objects, Arrays, Destructuring, Strings, Functions, Classes, Naming Conventions, and dozens more, each with numbered rules and rationale.
Why use const over var?The guide recommends const for all references and let only when reassignment is needed, avoiding var entirely, because const prevents accidental reassignment bugs and both const/let are properly block-scoped unlike the function-scoped var.
Is this guide translated into other languages?Yes, the README states the guide is available in other languages, with a dedicated Translation section listing community translations.
Why does this project matter beyond Airbnb?With nearly 150k GitHub stars, it has become one of the most widely adopted JavaScript style references in the industry, often used as a baseline for ESLint configs at other companies too.
Creator
airbnb
Size
3.7 MB
Stars
148.1K
Updated
CommitFeb 21
Age
13y
Commits · 90 Days