node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



npm version Downloads/month Build Status codecov Dependency Status

Additional ESLint rules for ESLint's directive-comments (e.g. //eslint-disable-line).

💿 Installation

npm install --save-dev eslint eslint-plugin-eslint-comments


  • Node.js ^4.0.0, ^6.0.0, or newer.
  • ESLint ^4.7.0, or newer.

📖 Usage

Write in your ESLint configurations:



    "extends": [

Or you can specify for each rule:

    "plugins": [
    "rules": {
        "eslint-comments/no-unused-disable": "error",
        "eslint-comments/no-unused-enable": "error",
        // ...


  • 🌟 mark: the rule is enabled by eslint-comments/recommended preset.
  • ✒️ mark: the rule is fixable by eslint --fix command.

Best Practices

Rule ID Description
🌟 eslint-comments/disable-enable-pair requires a eslint-enable comment for every eslint-disable comment
🌟 eslint-comments/no-aggregating-enable disallows eslint-enable comments for multiple eslint-disable comments
🌟 eslint-comments/no-duplicate-disable disallows duplicate eslint-disable comments
🌟 eslint-comments/no-unlimited-disable disallows eslint-disable comments without rule names
🌟 eslint-comments/no-unused-disable disallows unused eslint-disable comments
🌟 eslint-comments/no-unused-enable disallows unused eslint-enable comments

Stylistic Issues

Rule ID Description
eslint-comments/no-restricted-disable disallows eslint-disable comments about specific rules
eslint-comments/no-use disallows ESLint directive-comments

🚥 Semantic Versioning Policy

eslint-plugin-eslint-comments follows semantic versioning and ESLint's Semantic Versioning Policy.

📰 Changelog

🍻 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run build updates, index.js, and the header of all rule's documents.
  • npm run clean removes the coverage of the last npm test command.
  • npm run coverage shows the coverage of the last npm test command.
  • npm run lint runs ESLint for this codebase.
  • npm run watch runs tests and measures coverage when source code are changed.