Registry / devops / prettier-config-airbnb

prettier-config-airbnb

JSON →
library1.0.0jsnpmunverified

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.

npm install prettier-config-airbnb
INSTALL
IMPORT
SIG · PRETTIER-CONFIG-AI
P
prettier-config-airbnb
devopsjavascriptv1.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ const prettierConfig = require('prettier-config-airbnb')
✗ import prettierConfig from 'prettier-config-airbnb'
CommonJS only; no ESM export. Use require() to import.
default string (in .prettierrc.json)
✓ "prettier-config-airbnb"
✗ "@prettier/plugin-airbnb" or "airbnb"
In .prettierrc.json, use the exact package name (string) for the Prettier config key.
spread in .prettierrc.js
✓ module.exports = { ...require('prettier-config-airbnb'), printWidth: 120 }
✗ module.exports = { ...require('prettier-config-airbnb'), printWidth: 120 }
Common usage: spread the config object and override properties as needed.

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
Debug
Known issues
gotchaThe 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.
affects: >=1.0.0
gotchaPeer dependency on Prettier is not automatically installed; you must install Prettier separately.
fix
Run npm install --save-dev prettier alongside prettier-config-airbnb.
affects: >=1.0.0
breakingNo breaking changes yet as version 1.0.0 is the initial release.
fix
N/A
affects: none
Errors
Common errors & fixes
Cannot find module 'prettier-config-airbnb'
Package not installed or not in node_modules.
fix
Install via npm install --save-dev prettier-config-airbnb
Invalid config: 'prettier-config-airbnb' is not a valid config string.
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 loading config: Cannot read property 'printWidth' of undefined
Trying to import as ESM in a CommonJS context.
fix
Use require('prettier-config-airbnb') instead of import.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
prettierrequiredpeer dependency required to format code
Agent activity
6 hits · last 30 days
node
6
Resources
prettier-config-airbnb — npm install prettier-config-airbnb · libregistry