Skip to main content

๐ŸŸก Recommended

Use as the default baseline for most TypeScript codebases.

Config keyโ€‹

tsconfig.configs.recommended

Flat Config exampleโ€‹

import tsconfig from "eslint-plugin-tsconfig";

export default [tsconfig.configs.recommended];

This preset does not require type information.

For stricter coverage, see the strict preset, or use the all preset to enable every available rule.

import tsParser from "@typescript-eslint/parser";
import tsconfig from "eslint-plugin-tsconfig";

export default [
{
files: ["src/**/*.ts", "src/**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
plugins: {
tsconfig,
},
rules: {
...tsconfig.configs.recommended.rules,
},
},
];

This option is useful when you want the recommended rule set, but only for specific file globs.

Rules in this presetโ€‹

  • Fix legend:
    • ๐Ÿ”ง = autofixable
    • ๐Ÿ’ก = suggestions available
    • โ€” = report only
RuleFix
consistent-module-resolutionโ€”
no-deprecated-targetโ€”
require-force-consistent-casing-in-file-names๐Ÿ”ง
require-strict-mode๐Ÿ”ง
PresetDescription
๐Ÿ”ด strictRecommended plus a richer set of safety rules
๐ŸŸฃ allEvery rule, including experimental coverage
๐Ÿ“ค emit-configBest practices for TypeScript emit/output configuration
๐Ÿงน include-hygieneClean include, exclude, and files patterns
๐ŸŽฏ lib-targetConsistency between target, lib, and downlevelling
๐Ÿ“ฆ module-resolutionModern and consistent module resolution settings
๐Ÿ”— project-referencesCorrect TypeScript project references setup
๐Ÿ”’ strict-modeStrict mode options beyond the base strict flag