Registry / testing / eslint-config-airbnb-typescript

eslint-config-airbnb-typescript

JSON →
library18.0.0jsnpmunverified

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.

npm install eslint-config-airbnb-typescript
INSTALL
IMPORT
SIG · ESLINT-CONFIG-AIRB
E
eslint-config-airbnb-typescript
testingjavascriptv18.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.

airbnb-typescript
✓ extends: ['airbnb-typescript']
✗ require('eslint-config-airbnb-typescript')
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`.
airbnb-typescript/base
✓ extends: ['airbnb-typescript/base']
✗ extends: ['airbnb-typescript/base.js']
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.
parserOptions.project
✓ parserOptions: { project: './tsconfig.json' }
✗ parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'] }
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`.

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.

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 \ eslint-config-airbnb # or eslint-config-airbnb-base // .eslintrc.cjs (or .js) module.exports = { extends: [ 'airbnb', // or 'airbnb-base' if no React 'airbnb-typescript' ], parserOptions: { project: './tsconfig.json' // Path to your TypeScript config }, root: true, env: { node: true, browser: true, es2021: true } }; // tsconfig.json { "compilerOptions": { "target": "es2021", "module": "esnext", "lib": ["dom", "es2021"], "strict": true, "esModuleInterop": true, "skipLibCheck": true, // ... other compiler options }, "include": ["src/**/*", ".eslintrc.cjs"] } // package.json script for linting // "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
Debug
Known issues
breakingVersion 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.
fix
Run `npm install --save-dev @typescript-eslint/eslint-plugin@^7.0.0 @typescript-eslint/parser@^7.0.0 eslint@^8.56.0`
affects: >=18.0.0
breakingUpgrading 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.
fix
Run `npm install --save-dev @typescript-eslint/eslint-plugin@^5.13.0`
affects: >=17.0.0 <18.0.0
breakingVersion 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`).
fix
Run `npm install --save-dev eslint@^8.0.0 eslint-config-airbnb@^19.0.0` (or `eslint-config-airbnb-base@^15.0.0`)
affects: >=16.0.0 <17.0.0
gotchaThis 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.
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).
affects: >=1.0.0
gotchaWhen 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.
fix
Add `parserOptions: { project: './tsconfig.json' }` to your `.eslintrc` file. For complex project structures or monorepos, consider creating a dedicated `tsconfig.eslint.json`.
affects: >=1.0.0
Errors
Common errors & fixes
The file must be included in at least one of the projects provided.
ESLint is attempting to lint a file that is not covered by the `include` array in the `tsconfig.json` referenced by `parserOptions.project`.
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' }`.
ESLint: Cannot find module '@typescript-eslint/eslint-plugin/package.json' or its corresponding type declarations.
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.
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`.
ESLint: Cannot read config file: ./.eslintrc.js
Incorrect ESLint configuration file format or path, or missing required base config like `eslint-config-airbnb`.
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.
Upgrade
Version history
18.0.0latest on npm
Audit
Dependencies
@typescript-eslint/eslint-pluginrequiredRequired for TypeScript linting rules. Must match the version of @typescript-eslint/parser.
@typescript-eslint/parserrequiredRequired to parse TypeScript files for ESLint. Must match the version of @typescript-eslint/eslint-plugin.
eslintrequiredThe core ESLint engine that runs the configuration.
eslint-config-airbnboptionalThe base Airbnb configuration, used when React support is needed.
eslint-config-airbnb-baseoptionalThe base Airbnb configuration, used when React support is not needed.
Agent activity
4 hits · last 30 days
node
4
Resources