Airbnb ESLint Config with TypeScript and Prettier

5.0.0 · active · verified Sun Apr 19

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.

Common errors

Warnings

Install

Imports

Quickstart

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"]
}

view raw JSON →