eslint-plugin-disable

raw JSON →
2.0.3 verified Sat Apr 25 auth: no javascript maintenance

ESLint plugin to disable other ESLint plugins for specific files using file path patterns or inline comments. Current stable version is 2.0.3, release cadence low (last release 2020). Key differentiator: selectively disables entire plugins per file, reducing noise in mixed-codebases (e.g., tests vs. source) without disabling rules individually. v2.0.0 broke compatibility with pre-ESLint 6 configs and introduced a required processor declaration. Alternative to manually managing overrides for every rule.

error ESLint couldn't find the plugin "eslint-plugin-disable". (ESLint configuration error)
cause Plugin not installed or missing in plugins array in .eslintrc.
fix
Install: npm install eslint-plugin-disable --save-dev. Then add 'disable' to plugins array.
error Configuration for rule "react/jsx-uses-vars" is invalid: Value "error" is the wrong type.
cause React plugin is disabled via inline comment or override, but rules are still configured globally; ignores file.
fix
Ensure disabled plugins' rules are not applied to those files; plugin suppression occurs after rule loading.
error Processors is not defined in the configuration for file tests/test.js
cause Missing processor: 'disable/disable' in the override or root config.
fix
Add 'processor': 'disable/disable' to the relevant override or root config.
breaking v2.0.0 requires processor: 'disable/disable' in ESLint config; without it, plugin does nothing.
fix Add 'processor': 'disable/disable' to your ESLint config (root or overrides).
breaking v2.0.0 removed settings.extensions; extensions must be provided via ESLint CLI --ext.
fix Use ESLint CLI --ext option (e.g., eslint --ext .js,.ts .).
breaking v2.0.0 changed settings name from 'eslint-plugin-disable' to 'disable/plugins'.
fix Update settings in .eslintrc: use 'disable/plugins' array instead of nested object.
deprecated v1.0.0 removed 'extensions' setting; must use ESLint CLI --ext.
fix Use ESLint CLI --ext to list file extensions for linting.
gotcha Inline comment '/* eslint-plugin-disable */' without plugin names disables ALL registered plugins for that file.
fix Specify plugins to disable, or use 'eslint-plugin-disable-all-except' with explicit list.
npm install eslint-plugin-disable
yarn add eslint-plugin-disable
pnpm add eslint-plugin-disable

Configure .eslintrc to disable 'react' plugin for test files via override and inline comment. Both methods suppress react rules in those files.

// .eslintrc.json
{
  "plugins": ["react", "disable"],
  "processor": "disable/disable",
  "rules": {
    "react/jsx-uses-vars": "error"
  },
  "overrides": [
    {
      "files": ["tests/**/*.test.js"],
      "settings": {
        "disable/plugins": ["react"]
      }
    }
  ]
}

// src/Component.jsx
function Component() {
  return <div>Hello</div>;
}

// tests/test.js
/* eslint-plugin-disable react */
import { render } from '@testing-library/react';
// React plugin errors are suppressed