This package provides an ESLint configuration that extends the popular Airbnb Base JavaScript style guide with support for TypeScript. It integrates `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin` to enable linting TypeScript code according to Airbnb's rules. The current stable version is 1.1.0, last updated in April 2020. This config focuses solely on TypeScript and base JavaScript rules, differentiating it from other Airbnb TypeScript configurations that might include React-specific rules. It requires manual installation of its peer dependencies.
npm install eslint-config-airbnb-base-typescriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to configure `.eslintrc.js` to extend `airbnb-base-typescript`, set up the TypeScript parser with `parserOptions.project`, and lists the required `npm install` command. It also includes an example `tsconfig.json`.
Run `npm install --save-dev eslint eslint-plugin-import @typescript-eslint/eslint-plugin @typescript-eslint/parser` to ensure all necessary peer dependencies are present.
Add `parserOptions: { project: './tsconfig.json' }` (adjust path as needed) to your `.eslintrc.js` file. For complex project structures, create a dedicated `tsconfig.eslint.json` that extends your main `tsconfig.json` and includes all lintable files.If your project uses React, consider using `eslint-config-airbnb-typescript` (by `iamturns`) instead, which includes React support. Alternatively, you can manually add and configure React-related ESLint plugins to your `.eslintrc.js`.
Consider migrating to `eslint-config-airbnb-typescript` (by `iamturns`) or `eslint-config-airbnb-extended`, which are actively maintained and offer broader compatibility with newer ESLint versions and features, including flat config.
Run `npm install --save-dev eslint-plugin-import` to install the plugin. Ensure it's a compatible version with your ESLint setup.
Verify that your `tsconfig.json` (or a `tsconfig.eslint.json`) includes the files you are trying to lint in its `include` array. Adjust the `parserOptions.project` path if using a custom TypeScript configuration file for ESLint.
Ensure both `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` are installed and up-to-date. Run `npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser`.