Skip to main content

Getting Started

Install the plugin:

npm install --save-dev eslint-plugin-tsconfig

Enable one preset in your Flat Config:

import tsconfig from "eslint-plugin-tsconfig";

export default [
tsconfig.configs.recommended,
];

Each preset automatically sets:

  • files: ["**/*.{json,jsonc}"] (targeting tsconfig*.json files)
  • languageOptions.parser set to jsonc-eslint-parser

Alternative: manual scoped setupโ€‹

If you prefer full control, spread the preset rules manually:

import * as jsoncParser from "jsonc-eslint-parser";
import tsconfig from "eslint-plugin-tsconfig";

export default [
{
files: ["**/tsconfig*.json"],
languageOptions: {
parser: jsoncParser,
},
plugins: {
tsconfig,
},
rules: {
...tsconfig.configs.recommended.rules,
},
},
];
  1. Start with recommended (two essential rules).
  2. Fix violations, then move to strict for stronger conventions.
  3. Add focused presets (strict-mode, module-resolution, emit-config, etc.) to opt in to focused rule subsets.
  4. Use all when you want every available rule.

Focused subsetsโ€‹

  • ๐Ÿ”’ tsconfig.configs["strict-mode"]
  • ๐Ÿ“ฆ tsconfig.configs["module-resolution"]
  • ๐Ÿ“ค tsconfig.configs["emit-config"]
  • ๐Ÿงน tsconfig.configs["include-hygiene"]
  • ๐ŸŽฏ tsconfig.configs["lib-target"]
  • ๐Ÿ”— tsconfig.configs["project-references"]

See the Presets section in this sidebar for details and examples.