Registry / testing / eslint-config-airbnb-typescript-prettier

eslint-config-airbnb-typescript-prettier

JSON →
library5.0.0jsnpmunverified

eslint-config-airbnb-typescript-prettier is an ESLint shareable configuration designed to streamline the setup of linting for TypeScript projects by integrating the popular Airbnb JavaScript style guide with Prettier for consistent code formatting. Currently at version 5.0.0, this package aims to reduce boilerplate and configuration overhead for developers. Its release cadence is generally aligned with updates to its upstream dependencies, including ESLint, Airbnb's base config, `@typescript-eslint`, and Prettier itself, ensuring compatibility and leveraging the latest best practices. A key differentiator is its pre-configured merging of these complex tools, saving significant time in initial project setup and ongoing maintenance compared to configuring each tool individually. It handles the often-tricky interoperability between ESLint's parser, TypeScript's syntax, and Prettier's formatting rules, providing a cohesive and opinionated development experience.

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

Configuration Extension
✓ extends: "airbnb-typescript-prettier"
✗ extends: [require("eslint-config-airbnb-typescript-prettier")]
This string directly references the shareable configuration in your `.eslintrc.js` file's `extends` array, telling ESLint to load its rules, parser, and plugin settings.
TypeScript Project Options
✓ parserOptions: { project: "./tsconfig.json" }
✗ parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'] }
For type-aware linting rules provided by `@typescript-eslint`, you must specify the `project` option within `parserOptions` to point to your `tsconfig.json`. This is often required for the more advanced rules.
Direct Module Import
✓
✗ import config from 'eslint-config-airbnb-typescript-prettier';
This package is an ESLint shareable config, designed to be referenced by name in `.eslintrc.js` files via the `extends` property, not directly imported into JavaScript/TypeScript code for programmatic use.

Installs the package and its peer dependencies, then configures ESLint to use the Airbnb TypeScript Prettier ruleset with project-specific TypeScript parsing.

npm install --save-dev typescript eslint prettier eslint-config-airbnb-typescript-prettier // .eslintrc.js module.exports = { extends: "airbnb-typescript-prettier", parserOptions: { project: "./tsconfig.json" }, rules: { // Override/add custom rules here if needed // e.g., 'import/prefer-default-export': 'off' } }; // tsconfig.json (minimal example) { "compilerOptions": { "target": "es2021", "module": "commonjs", "jsx": "react-jsx", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "include": ["src/**/*.ts", "src/**/*.tsx"] }
Debug
Known issues
breakingVersion 5.0.0 of `eslint-config-airbnb-typescript-prettier` introduces updated peer dependency requirements. Ensure your `eslint`, `prettier`, and `typescript` installations meet the specified versions (e.g., `eslint: ^7.32.0 || ^8.2.0`, `prettier: ^1.18.2 || ^2.0.0`, `typescript: >=3.3.1`). Older versions may lead to conflicts or failed linting processes.
fix
Update your `eslint`, `prettier`, and `typescript` packages to match the peer dependency range specified by `eslint-config-airbnb-typescript-prettier@5.0.0` using `npm install` or `yarn add`.
affects: >=5.0.0
gotchaOmitting or incorrectly configuring `parserOptions.project` in your `.eslintrc.js` will prevent type-aware linting rules from working. This can lead to ESLint errors during startup or silent failure of critical TypeScript-specific checks.
fix
Ensure your `.eslintrc.js` includes `parserOptions: { project: './tsconfig.json' }` and that the path to your `tsconfig.json` is correct and accessible from the ESLint configuration file.
affects: >=1.0.0
gotchaWhen combining `eslint-config-airbnb-typescript-prettier` with other ESLint configurations, especially those involving Prettier, the order within the `extends` array in `.eslintrc.js` is critical. `eslint-config-prettier` (which is part of this config's chain) should always be the *last* item in the `extends` array to ensure it correctly disables conflicting ESLint rules.
fix
Place `"airbnb-typescript-prettier"` as the last entry in your `extends` array, or ensure any custom Prettier-disabling configs are placed after other rule-defining configs.
affects: >=1.0.0
gotchaUsing `parserOptions.project` for type-aware linting can significantly increase ESLint's runtime performance, especially in large codebases, due to the need to load and parse the TypeScript project graph.
fix
For faster linting in development, consider using `eslint-plugin-only-warn` or separating type-aware rules into a script that runs less frequently (e.g., CI/CD, pre-commit hook) or only on changed files.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Failed to load parser '@typescript-eslint/parser' declared in 'airbnb-typescript-prettier'
The `@typescript-eslint/parser` package, a critical peer dependency, is either not installed or its version is incompatible.
fix
Run `npm install --save-dev @typescript-eslint/parser` to ensure the parser is installed. Check `npm view eslint-config-airbnb-typescript-prettier peerDependencies` for compatible versions.
Parsing error: 'parserOptions.project' has been set for @typescript-eslint/parser.
ESLint's TypeScript parser requires `parserOptions.project` to correctly resolve type information, but it's either missing, misspelled, or points to an invalid `tsconfig.json` file.
fix
Add or correct the `parserOptions` object in your `.eslintrc.js` file: `{ parserOptions: { project: './tsconfig.json' } }`, ensuring `tsconfig.json` exists at the specified path.
The "extends" option in .eslintrc.js has an invalid configuration for 'airbnb-typescript-prettier'.
The `eslint-config-airbnb-typescript-prettier` package is not installed in your project, or there is a typo in the `extends` array.
fix
Verify the package is installed with `npm list eslint-config-airbnb-typescript-prettier` and run `npm install --save-dev eslint-config-airbnb-typescript-prettier` if it's missing. Double-check the spelling in your `.eslintrc.js`.
[eslint] Delete `␍` (`prettier/prettier`)
ESLint, via `eslint-plugin-prettier`, is detecting a formatting inconsistency (e.g., line endings, spacing) that Prettier would fix, indicating an unformatted file or a conflict in configuration.
fix
Run `eslint --fix src/**/*.ts` (or your relevant files) to automatically fix the issue, or configure your IDE to run `eslint --fix` on save. Ensure your editor's Prettier settings (if any) are aligned with the project.
Error: You have used a rule which requires parserServices to be generated. You must therefore provide a value for the 'parserOptions.project' property for @typescript-eslint/parser.
A TypeScript-aware ESLint rule requires access to type information, but the `project` property is missing or improperly configured in `parserOptions`.
fix
Add `parserOptions: { project: './tsconfig.json' }` to your `.eslintrc.js` and ensure that the specified `tsconfig.json` path is correct and accessible.
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
eslintrequiredRequired as the core linting engine.
prettierrequiredRequired for consistent code formatting and integration with ESLint.
typescriptrequiredRequired for parsing TypeScript code and enabling type-aware linting rules.
@typescript-eslint/eslint-pluginrequiredImplicitly required as a peer dependency of the underlying configuration to enable TypeScript-specific linting rules.
@typescript-eslint/parserrequiredImplicitly required as a peer dependency of the underlying configuration to parse TypeScript code for ESLint.
eslint-config-airbnb-baserequiredImplicitly required as a peer dependency to provide the base Airbnb JavaScript style guide.
eslint-plugin-importrequiredImplicitly required for linting of ES2015+ import/export syntax.
eslint-plugin-jsx-a11yrequiredImplicitly required for static analysis of JSX elements to enforce accessibility rules.
eslint-plugin-reactrequiredImplicitly required for React specific linting rules.
eslint-plugin-react-hooksrequiredImplicitly required for React Hooks specific linting rules.
eslint-config-prettierrequiredImplicitly required to disable ESLint rules that conflict with Prettier.
eslint-plugin-prettierrequiredImplicitly required to run Prettier as an ESLint rule and report differences.
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-config-airbnb-typescript-prettier — npm install eslint-config-airbnb-typescript-prettier · libregistry