{"id":20287,"library":"prettier-config-airbnb","title":"prettier-config-airbnb","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/austrokhart/prettier-config-airbnb","tags":["javascript","prettier","config","airbnb"],"install":[{"cmd":"npm install prettier-config-airbnb","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-config-airbnb","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-config-airbnb","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to format code","package":"prettier","optional":false}],"imports":[{"note":"CommonJS only; no ESM export. Use require() to import.","wrong":"import prettierConfig from 'prettier-config-airbnb'","symbol":"default","correct":"const prettierConfig = require('prettier-config-airbnb')"},{"note":"In .prettierrc.json, use the exact package name (string) for the Prettier config key.","wrong":"\"@prettier/plugin-airbnb\" or \"airbnb\"","symbol":"default string (in .prettierrc.json)","correct":"\"prettier-config-airbnb\""},{"note":"Common usage: spread the config object and override properties as needed.","wrong":"module.exports = { ...require('prettier-config-airbnb'), printWidth: 120 }","symbol":"spread in .prettierrc.js","correct":"module.exports = { ...require('prettier-config-airbnb'), printWidth: 120 }"}],"quickstart":{"code":"npm install --save-dev prettier prettier-config-airbnb\necho 'prettier-config-airbnb' > .prettierrc.json\necho '{\"version\": \"1.0.0\"}' > package.json\nnpx prettier --check src/**/*.js","lang":"javascript","description":"Install prettier and the config, create .prettierrc.json with the config name, then check formatting."},"warnings":[{"fix":"Use require() in CommonJS files or use a dynamic import with .mjs extension.","message":"The package is CommonJS-only; it cannot be imported via ESM import syntax in Node.js without a bundler or transform.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run npm install --save-dev prettier alongside prettier-config-airbnb.","message":"Peer dependency on Prettier is not automatically installed; you must install Prettier separately.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"N/A","message":"No breaking changes yet as version 1.0.0 is the initial release.","severity":"breaking","affected_versions":"none"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install via npm install --save-dev prettier-config-airbnb","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'prettier-config-airbnb'"},{"fix":"In .prettierrc.json, ensure the content is exactly: \"prettier-config-airbnb\" (no extra braces).","cause":"Misplaced config key; Prettier expects the string directly as the config value.","error":"Invalid config: 'prettier-config-airbnb' is not a valid config string."},{"fix":"Use require('prettier-config-airbnb') instead of import.","cause":"Trying to import as ESM in a CommonJS context.","error":"Error loading config: Cannot read property 'printWidth' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}