{"id":19743,"library":"eslint-plugin-eslint-comments","title":"eslint-plugin-eslint-comments","description":"An ESLint plugin providing additional rules specifically for ESLint directive comments like // eslint-disable-line, // eslint-disable-next-line, and global comment directives. Version 3.2.0 is stable, with maintenance releases. It enforces best practices around disable/enable pairs, unused disable directives, and consistent use of eslint-env/eslint-enable. Differentiates from core ESLint rules by focusing exclusively on the correctness and hygiene of ESLint's own comment directives. Supports ESLint >=4.19.1 and Node >=6.5.0.","status":"active","version":"3.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/mysticatea/eslint-plugin-eslint-comments","tags":["javascript","eslint","eslintplugin","eslint-plugin","plugin","comment","comments","directive","global"],"install":[{"cmd":"npm install eslint-plugin-eslint-comments","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-eslint-comments","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-eslint-comments","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin components rely on ESLint core APIs.","package":"eslint","optional":false}],"imports":[{"note":"CommonJS is the default; ESM usage requires eslint-plugin-eslint-comments >=4.x or a bundler.","wrong":"import plugin from 'eslint-plugin-eslint-comments'","symbol":"plugin","correct":"const plugin = require('eslint-plugin-eslint-comments')"},{"note":"Direct access to rules object for custom configurations.","wrong":"const rules = require('eslint-plugin-eslint-comments').rules","symbol":"rules","correct":"const { rules } = require('eslint-plugin-eslint-comments')"},{"note":"Use configs.recommended to extend the recommended preset.","wrong":"","symbol":"configs","correct":"const { configs } = require('eslint-plugin-eslint-comments')"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  plugins: ['eslint-comments'],\n  extends: ['plugin:eslint-comments/recommended'],\n  rules: {\n    'eslint-comments/disable-enable-pair': 'error',\n    'eslint-comments/no-duplicate-disable': 'error',\n    'eslint-comments/no-unlimited-disable': 'error',\n    'eslint-comments/no-unused-enable': 'error',\n    'eslint-comments/no-unused-disable': 'warn',\n    'eslint-comments/no-restricted-disable': 'off'\n  }\n};","lang":"javascript","description":"Shows how to enable the plugin and its recommended rules in an ESLint config."},"warnings":[{"fix":"Upgrade ESLint to >=4.19.1 and Node to >=6.5.0.","message":"v3.0.0 dropped support for ESLint <4.19.1 and Node <6.5.0.","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Manually enable eslint-comments/no-unused-disable if desired, or use --report-unused-disable-directives on CLI.","message":"v3.0.0 removed no-unused-disable from the recommended preset.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Update to v3.1.2 or later where autofix is removed.","message":"The no-unused-disable rule's autofix was reverted in v3.1.1 due to issues.","severity":"deprecated","affected_versions":"3.1.0"},{"fix":"Ensure ESLint cache is cleared if rules appear stale.","message":"The disable-enable-pair rule with allowWholeFile option may cause false positives in some editors like WebStorm.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install eslint-plugin-eslint-comments --save-dev and ensure 'eslint-comments' is in plugins list.","cause":"Plugin not installed or not added to plugins array.","error":"ESLint couldn't find the plugin \"eslint-plugin-eslint-comments\"."},{"fix":"Use 'eslint-comments/disable-enable-pair' not 'disable-enable-pair'.","cause":"Rules are nested under 'eslint-comments/' namespace; may have used wrong prefix.","error":"Definition for rule 'eslint-comments/disable-enable-pair' was not found."},{"fix":"npm install eslint-plugin-eslint-comments --save-dev","cause":"Plugin not installed in the project's node_modules.","error":"Failed to load plugin 'eslint-comments' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-eslint-comments'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}