prettier-config-airbnb

raw JSON →
1.0.0 verified Sat Apr 25 auth: no javascript

A Prettier configuration that mirrors the Airbnb JavaScript style guide. Version 1.0.0 provides a drop-in shareable config with settings like single quotes, trailing commas, and 100 print width. Ideal for teams adopting Airbnb's style without manual setup. Updated infrequently; relies on Prettier as a peer dependency.

error Cannot find module 'prettier-config-airbnb'
cause Package not installed or not in node_modules.
fix
Install via npm install --save-dev prettier-config-airbnb
error Invalid config: 'prettier-config-airbnb' is not a valid config string.
cause Misplaced config key; Prettier expects the string directly as the config value.
fix
In .prettierrc.json, ensure the content is exactly: "prettier-config-airbnb" (no extra braces).
error Error loading config: Cannot read property 'printWidth' of undefined
cause Trying to import as ESM in a CommonJS context.
fix
Use require('prettier-config-airbnb') instead of import.
gotcha The package is CommonJS-only; it cannot be imported via ESM import syntax in Node.js without a bundler or transform.
fix Use require() in CommonJS files or use a dynamic import with .mjs extension.
gotcha Peer dependency on Prettier is not automatically installed; you must install Prettier separately.
fix Run npm install --save-dev prettier alongside prettier-config-airbnb.
breaking No breaking changes yet as version 1.0.0 is the initial release.
fix N/A
npm install prettier-config-airbnb
yarn add prettier-config-airbnb
pnpm add prettier-config-airbnb

Install prettier and the config, create .prettierrc.json with the config name, then check formatting.

npm install --save-dev prettier prettier-config-airbnb
echo 'prettier-config-airbnb' > .prettierrc.json
echo '{"version": "1.0.0"}' > package.json
npx prettier --check src/**/*.js