ESLint Configuration for TypeScript Projects

3.0.0 · active · verified Tue Apr 21

eslint-config-typescript is an opinionated, base set of recommended ESLint rules specifically designed for TypeScript projects. It bundles configurations for common scenarios, including React and Prettier integration. The current stable version is 3.0.0. Release cadence appears to be driven by dependency updates and feature additions, with major versions introducing breaking changes. Its key differentiator is providing a pre-configured, modular setup that simplifies ESLint adoption for TypeScript, reducing the boilerplate of manually configuring `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` while offering extensions for popular tools like Prettier and React out-of-the-box. It requires ESLint 6.0.0 or higher for full functionality.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a complete ESLint configuration for a TypeScript/React project, integrating Prettier with custom settings and additional plugins like `filenames` and `jest`.

{
  "extends": [
    "typescript",
    "typescript/prettier-react"
  ],
  "plugins": ["filenames", "jest"],
  "env": {
    "jest": true,
    "node": true
  },
  "rules": {
    "filenames/no-index": "error",
    "filenames/match-exported": ["error", "kebab"],
    "jest/no-disabled-tests": "error",
    "jest/no-focused-tests": "error",
    "jest/no-identical-title": "error",
    "jest/valid-expect": "error",
    "prettier/prettier": [
      "error",
      {
        "semi": false,
        "tabWidth": 4,
        "singleQuote": true
      }
    ]
  }
}

view raw JSON →