A Babel preset for transforming JavaScript according to the Airbnb Style Guide, version 5.0.0. It includes transforms for all stage 4 (ES2018) and stage 3 syntax permitted in the guide, excluding generators, async/await, async iterators, and lifted template literal restrictions. It uses @babel/preset-env for targeting environments and supports React development mode, PropTypes removal, and optional loose class mode. Peer dependencies include @babel/core ^7.0.0 and @babel/runtime ^7.0.0. Differentiators: opinionated selection based on Airbnb style, built-in support for React PropTypes removal, and environment targeting via @babel/preset-env. Released as needed, with last major update aligning with Babel 7.
npm install babel-preset-airbnbVerified import paths — ran on the pinned version, not inferred.
Quick setup for babel-preset-airbnb with Node.js target, React development mode, and PropTypes removal toggle.
Use babel-preset-airbnb@3 for Babel 6, or upgrade to Babel 7.
If you need these features, add @babel/plugin-transform-regenerator and @babel/plugin-transform-async-to-generator manually.
Set removePropTypes: true or removePropTypes: { mode: 'remove' } for production builds.Merge your custom targets into the 'targets' object instead of using 'additionalTargets'.
Only enable debug for troubleshooting; avoid in CI or production logs.
Add @babel/runtime to your dependencies or devDependencies.
npm install --save-dev @babel/core @babel/runtime
npm install --save-dev babel-preset-airbnb
Downgrade to babel-preset-airbnb@3 or upgrade Babel to v7.
If needed, add @babel/plugin-transform-runtime or @babel/polyfill.
Use presets: [['airbnb', { targets: ... }]]