ESLint rules grouped by category
ESLint ships dozens of built-in core rules. Since ESLint 8 they are organized
into three categories by intent, and each rule carries two important flags:
whether eslint --fix can auto-correct it, and whether the eslint:recommended
preset enables it. This searchable reference lists representative core rules per
category so you can find what a rule does and how to wire it up.
How it works
A rule is enabled in your config by name with a severity:
// eslint.config.js (flat config)
export default [
{
rules: {
"no-unused-vars": "error",
"eqeqeq": ["error", "always"],
"prefer-const": "warn"
}
}
];
Rules in the Possible Problems category catch likely bugs (no-undef,
no-unreachable). Suggestions rules nudge toward better patterns
(prefer-const, eqeqeq). Layout & Formatting rules govern whitespace and
are mostly fixable but now deprecated in favour of Prettier or @stylistic.
Tips and notes
- Start from
eslint:recommended, then add rules as your team agrees on them. - Prefer
--fixfor the fixable Suggestion and Layout rules to save manual work. - Move pure formatting to Prettier; keep ESLint focused on correctness.
- A rule’s severity can be
off,warnorerror; onlyerrorfails CI.