Course contentsShow
← JavaScript
Lesson 2569 of 2,72352. Linting and FormattingFree lesson

Overriding Rules in Extended Configs

Master how to selectively override or disable specific rules from extended configurations.

Overriding Rules in Extended Configs

What you'll learn: How to selectively customize or turn off specific rules inherited from shared ESLint configurations.

The Core Idea

When you extend a shareable config (like eslint:recommended or a popular style guide), you inherit all its rules. But what if one rule doesn't fit your team's workflow or causes too many false positives? You don't need to abandon the entire config—you can override individual rules right in your own .eslintrc file.

Think of it like inheriting a house with all its furniture. You love most of it, but that bright orange couch? You can swap it out without rebuilding the entire house.

How It Works

Rules you define in the rules section of your configuration take precedence over inherited rules. You can:

  • Disable a rule entirely by setting it to "off" or 0
  • Change severity from "error" to "warn" (or vice versa)
  • Modify rule options while keeping the rule active
{
  "extends": "eslint:recommended",
  "rules": {
    // Turn off a rule from the extended config
    "no-console": "off",
    
    // Change severity from error to warning
    "no-unused-vars": "warn",
    
    // Keep rule but change its options
    "quotes": ["error", "single"]
  }
}

The order matters: ESLint applies rules from extended configs first, then your local overrides cascade on top. If you extend multiple configs, later ones override earlier ones, and your local rules always have the final say.

Key Takeaway: You control your linting rules—extend shared configs for consistency, then override specific rules in your local configuration to match your team's needs without losing the benefits of shared standards.