ESLint Rules
ESLint rules are the core of the linter - they analyze your code and report problems. Each rule is independent and can be configured individually.Rule Types
Rules are categorized by their purpose:- Problem Rules: These rules identify code that will cause errors or unexpected behavior
- Suggestion Rules: These rules suggest alternate ways of doing things
- Layout Rules: These rules care about how the code looks rather than how it executes
Using Rules
Configure rules in your ESLint configuration file:Rule Severity
Each rule can be set to one of three severity levels:"off"or0- turn the rule off"warn"or1- turn the rule on as a warning (doesn’t affect exit code)"error"or2- turn the rule on as an error (exit code will be 1)
Browse Rules by Category
View rules organized by their purpose:- Problem Rules - Prevent errors and bugs
- Suggestion Rules - Code improvements
- Layout Rules - Code formatting
Search Rules
Use the search below to find specific rules:You can search by rule name, category, or keywords related to what the rule checks.
Popular Rules
Problem Detection
- array-callback-return - Enforce return statements in array callbacks
- no-await-in-loop - Disallow await inside loops
- no-constant-binary-expression - Disallow expressions that always evaluate to the same value