Suggest an editImprove this articleRefine the answer for “What is an ESLint rule?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)An **ESLint rule** is a separate, checkable condition that the code must satisfy, and each rule is responsible for a specific aspect of quality, style, or safety. **Key point:** through a set of such rules, ESLint ensures cleanliness, predictability, and consistency of code in a project.Shown above the full answer for quick recall.Answer (EN)ImageAn ESLint rule is a separate, checkable condition that the code must satisfy. Each rule is responsible for a **specific aspect of quality, style, or safety**, and when it is violated, ESLint reports an error or a warning. --- ### **What a rule does** A rule can: - **forbid** a dangerous or unwanted construct (for example, `no-eval`, `no-unused-vars`) - **enforce a consistent style** (for example, `quotes` - single or double quotes) - **warn about potential bugs** (for example, `eqeqeq` - use `===` instead of `==`) --- ### **What a rule looks like in the config** In `.eslintrc`, each rule has a level: ```json { "rules": { "no-unused-vars": "warn", "eqeqeq": "error", "quotes": ["error", "single"] } } ``` Where `"off" | "warn" | "error"` means: | Level | What it means | |---|---| | `"off"` | the rule is disabled | | `"warn"` | a warning, but the build does not fail | | `"error"` | an error - it affects the build/commit | --- ### **An important point** ESLint is a set of *rules*, not one general requirement. Each rule is responsible for its own area of the code, and together they form the project's **code style and quality rules**. --- ### **Summary** > **An ESLint rule is a specific check that controls a certain behavior or style in the code and signals its violation.** Through a set of such rules, ESLint ensures cleanliness, predictability, and consistency of code in a project.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.