๐ก 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.
Alternative: apply recommended rules in your own scopeโ
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โ
Fixlegend:๐ง= autofixable๐ก= suggestions availableโ= report only
| Rule | Fix |
|---|---|
consistent-module-resolution | โ |
no-deprecated-target | โ |
require-force-consistent-casing-in-file-names | ๐ง |
require-strict-mode | ๐ง |
Related presetsโ
| Preset | Description |
|---|---|
| ๐ด strict | Recommended plus a richer set of safety rules |
| ๐ฃ all | Every rule, including experimental coverage |
| ๐ค emit-config | Best practices for TypeScript emit/output configuration |
| ๐งน include-hygiene | Clean include, exclude, and files patterns |
| ๐ฏ lib-target | Consistency between target, lib, and downlevelling |
| ๐ฆ module-resolution | Modern and consistent module resolution settings |
| ๐ project-references | Correct TypeScript project references setup |
| ๐ strict-mode | Strict mode options beyond the base strict flag |