{"id":10813,"library":"eslint-config-airbnb-typescript","title":"Airbnb ESLint Config for TypeScript","description":"eslint-config-airbnb-typescript extends the popular Airbnb ESLint configuration to provide full support for TypeScript projects. It ensures consistent code style and identifies potential issues across JavaScript and TypeScript files. Currently stable at version 18.0.0, this configuration typically updates in lockstep with major releases of `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser`, and `eslint`, as well as updates to `eslint-config-airbnb` or `eslint-config-airbnb-base`. The project has a moderately active release cadence, issuing updates to align with its core dependencies and address bug fixes. Its key differentiator is providing a TypeScript-compatible wrapper around the widely adopted and opinionated Airbnb style guide, making it a go-to choice for teams wanting to enforce a strict, well-defined coding standard in their TypeScript codebase. It requires manual peer dependency installation, a common pattern for shareable ESLint configurations.","status":"active","version":"18.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/iamturns/eslint-config-airbnb-typescript","tags":["javascript","airbnb","config","es2015","es2016","es2017","es2018","eslint","eslintconfig"],"install":[{"cmd":"npm install eslint-config-airbnb-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-airbnb-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-airbnb-typescript","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for TypeScript linting rules. Must match the version of @typescript-eslint/parser.","package":"@typescript-eslint/eslint-plugin","optional":false},{"reason":"Required to parse TypeScript files for ESLint. Must match the version of @typescript-eslint/eslint-plugin.","package":"@typescript-eslint/parser","optional":false},{"reason":"The core ESLint engine that runs the configuration.","package":"eslint","optional":false},{"reason":"The base Airbnb configuration, used when React support is needed.","package":"eslint-config-airbnb","optional":true},{"reason":"The base Airbnb configuration, used when React support is not needed.","package":"eslint-config-airbnb-base","optional":true}],"imports":[{"note":"This is an ESLint configuration, not a JS module. It is referenced in the 'extends' array of your .eslintrc file, not imported via `import` or `require`.","wrong":"require('eslint-config-airbnb-typescript')","symbol":"airbnb-typescript","correct":"extends: ['airbnb-typescript']"},{"note":"Use this path in your ESLint config's 'extends' array when you do not need React-specific rules. It configures the non-React version of the Airbnb style guide for TypeScript.","wrong":"extends: ['airbnb-typescript/base.js']","symbol":"airbnb-typescript/base","correct":"extends: ['airbnb-typescript/base']"},{"note":"The `project` option within `parserOptions` is crucial for ESLint to understand your TypeScript project context, enabling type-aware linting rules. Ensure it points to your main `tsconfig.json` or a dedicated `tsconfig.eslint.json`.","wrong":"parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'] }","symbol":"parserOptions.project","correct":"parserOptions: { project: './tsconfig.json' }"}],"quickstart":{"code":"npm install --save-dev eslint-config-airbnb-typescript \\\n            @typescript-eslint/eslint-plugin@^7.0.0 \\\n            @typescript-eslint/parser@^7.0.0 \\\n            eslint@^8.56.0 \\\n            eslint-config-airbnb # or eslint-config-airbnb-base\n\n// .eslintrc.cjs (or .js)\nmodule.exports = {\n  extends: [\n    'airbnb', // or 'airbnb-base' if no React\n    'airbnb-typescript'\n  ],\n  parserOptions: {\n    project: './tsconfig.json' // Path to your TypeScript config\n  },\n  root: true,\n  env: {\n    node: true,\n    browser: true,\n    es2021: true\n  }\n};\n\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"target\": \"es2021\",\n    \"module\": \"esnext\",\n    \"lib\": [\"dom\", \"es2021\"],\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    // ... other compiler options\n  },\n  \"include\": [\"src/**/*\", \".eslintrc.cjs\"]\n}\n\n// package.json script for linting\n// \"lint\": \"eslint . --ext .js,.jsx,.ts,.tsx\"\n\n","lang":"typescript","description":"This quickstart demonstrates how to install the package and its peer dependencies, configure your `.eslintrc` file to extend the Airbnb TypeScript rules (with React support), and set up the `parserOptions.project` for type-aware linting."},"warnings":[{"fix":"Run `npm install --save-dev @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0 eslint@^8.56.0`","message":"Version 18.0.0 introduced a breaking change by upgrading peer dependencies. You must update `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` to `^7.0.0` or above, and `eslint` to `^8.56.0` or above.","severity":"breaking","affected_versions":">=18.0.0"},{"fix":"Run `npm install --save-dev @typescript-eslint/eslint-plugin@^5.13.0`","message":"Upgrading to version 17.0.0 requires updating `@typescript-eslint/eslint-plugin` to `^5.13.0` due to a peer dependency bump related to the `space-before-blocks` rule.","severity":"breaking","affected_versions":">=17.0.0 <18.0.0"},{"fix":"Run `npm install --save-dev eslint@^8.0.0 eslint-config-airbnb@^19.0.0` (or `eslint-config-airbnb-base@^15.0.0`)","message":"Version 16.0.0 introduced breaking changes by updating to ESLint v8 and requiring `eslint-config-airbnb` dependency to `^19.0.0` (or `eslint-config-airbnb-base` to `^15.0.0`).","severity":"breaking","affected_versions":">=16.0.0 <17.0.0"},{"fix":"Always install peer dependencies explicitly: `npm install --save-dev eslint-config-airbnb-typescript @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0 eslint@^8.56.0` (adjust versions as per latest major release).","message":"This package relies heavily on its peer dependencies. Failure to install the correct versions of `eslint`, `@typescript-eslint/eslint-plugin`, and `@typescript-eslint/parser` will result in errors or incorrect linting behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add `parserOptions: { project: './tsconfig.json' }` to your `.eslintrc` file. For complex project structures or monorepos, consider creating a dedicated `tsconfig.eslint.json`.","message":"When using this config, you must set `parserOptions.project` in your ESLint configuration to the path of your `tsconfig.json` file to enable type-aware linting rules.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Create a `tsconfig.eslint.json` that extends your main `tsconfig.json` and explicitly includes all files you intend to lint (e.g., `\"include\": [\"src/**/*.ts\", \"src/**/*.js\", \"test/**/*.ts\"]`). Then update your `.eslintrc` to `parserOptions: { project: './tsconfig.eslint.json' }`.","cause":"ESLint is attempting to lint a file that is not covered by the `include` array in the `tsconfig.json` referenced by `parserOptions.project`.","error":"The file must be included in at least one of the projects provided."},{"fix":"Ensure all peer dependencies are correctly installed with compatible versions. For v18.0.0, this means `npm install --save-dev @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0 eslint@^8.56.0`.","cause":"One or more of the required peer dependencies for `eslint-config-airbnb-typescript` (especially `@typescript-eslint/eslint-plugin` or `@typescript-eslint/parser`) are either not installed or are of an incompatible version.","error":"ESLint: Cannot find module '@typescript-eslint/eslint-plugin/package.json' or its corresponding type declarations."},{"fix":"Verify that your `.eslintrc` file is valid JSON or CommonJS, correctly extends `airbnb` (or `airbnb-base`) before `airbnb-typescript`, and that the base Airbnb config is installed as a dependency.","cause":"Incorrect ESLint configuration file format or path, or missing required base config like `eslint-config-airbnb`.","error":"ESLint: Cannot read config file: ./.eslintrc.js"}],"ecosystem":"npm"}