eslint-stylistic-airbnb

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

ESLint shareable config that enforces the Airbnb style guide using ESLint Stylistic for formatting instead of Prettier. Current version 3.1.0 supports ESLint >=8.57 (including v9) and offers both flat config (ESM) and legacy config formats. Key differentiators: modular addon system for JavaScript, TypeScript, React, Vue, and JSX; replaces deprecated eslint-config-airbnb rules; provides ready-to-use presets with zero configuration. Active development with frequent releases. Ships TypeScript types.

error Error: Cannot find module 'eslint-stylistic-airbnb'
cause Package is not installed or project is using npm/yarn without installing peer deps.
fix
npm install -D eslint @stylistic/eslint-plugin eslint-stylistic-airbnb globals
error Error: Failed to load config "airbnb" to extend from.
cause Using require() on v3 with default export; legacy config path required.
fix
Use 'eslint-stylistic-airbnb/legacy' in .eslintrc extends field.
error TypeError: Cannot read properties of undefined (reading 'flat')
cause Accessing airbnb.configs.flat when configs is undefined (wrong import style).
fix
Use airbnb.configs['flat/recommended'] as a string property access.
breaking v3.0.0: Complete restructuring to modular config system. The old single config export is replaced by multiple addon configs (flat/recommended, flat/addon-typescript, etc.). The legacy path changed.
fix Use airbnb.configs['flat/recommended'] instead of direct import. For legacy, use require('eslint-stylistic-airbnb/legacy').
breaking v2.0.0: Minimum ESLint version bumped to 8.57. Configs no longer compatible with ESLint <8.57.
fix Upgrade ESLint to >=8.57.0.
deprecated Legacy config (.eslintrc) is deprecated in v3.0.0+ and may be removed in future major releases.
fix Migrate to flat config (eslint.config.js).
gotcha Requires globals package to be installed separately for flat config (not a direct dependency).
fix Install globals as devDependency and import in your eslint.config.js.
gotcha Optional peer dependencies (eslint-plugin-react, eslint-plugin-vue) are not auto-installed. Missing them causes linting errors.
fix Install the relevant peer dependency when using Vue or React addons.
npm install eslint-stylistic-airbnb
yarn add eslint-stylistic-airbnb
pnpm add eslint-stylistic-airbnb

Minimal flat config setup for JavaScript using the recommended base config.

// eslint.config.js
import airbnb from 'eslint-stylistic-airbnb';
import globals from 'globals';

export default [
  { ignores: ['dist'] },
  airbnb.configs['flat/recommended'],
  {
    languageOptions: {
      globals: globals.browser,
    },
    linterOptions: {
      reportUnusedDisableDirectives: 'error',
    },
  },
];