Registry / testing / eslint-plugin-eslint-comments

eslint-plugin-eslint-comments

JSON →
library3.2.0jsnpmunverified

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.

npm install eslint-plugin-eslint-comments
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-ESLI
E
eslint-plugin-eslint-comments
testingjavascriptv3.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
const plugin = require('eslint-plugin-eslint-comments')
import plugin from 'eslint-plugin-eslint-comments'
CommonJS is the default; ESM usage requires eslint-plugin-eslint-comments >=4.x or a bundler.
rules
const { rules } = require('eslint-plugin-eslint-comments')
const rules = require('eslint-plugin-eslint-comments').rules
Direct access to rules object for custom configurations.
configs
const { configs } = require('eslint-plugin-eslint-comments')
Use configs.recommended to extend the recommended preset.

Shows how to enable the plugin and its recommended rules in an ESLint config.

// .eslintrc.js module.exports = { plugins: ['eslint-comments'], extends: ['plugin:eslint-comments/recommended'], rules: { 'eslint-comments/disable-enable-pair': 'error', 'eslint-comments/no-duplicate-disable': 'error', 'eslint-comments/no-unlimited-disable': 'error', 'eslint-comments/no-unused-enable': 'error', 'eslint-comments/no-unused-disable': 'warn', 'eslint-comments/no-restricted-disable': 'off' } };
Debug
Known issues
breakingv3.0.0 dropped support for ESLint <4.19.1 and Node <6.5.0.
fix
Upgrade ESLint to >=4.19.1 and Node to >=6.5.0.
affects: <3.0.0
breakingv3.0.0 removed no-unused-disable from the recommended preset.
fix
Manually enable eslint-comments/no-unused-disable if desired, or use --report-unused-disable-directives on CLI.
affects: >=3.0.0
deprecatedThe no-unused-disable rule's autofix was reverted in v3.1.1 due to issues.
fix
Update to v3.1.2 or later where autofix is removed.
affects: 3.1.0
gotchaThe disable-enable-pair rule with allowWholeFile option may cause false positives in some editors like WebStorm.
fix
Ensure ESLint cache is cleared if rules appear stale.
affects: >=2.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-eslint-comments".
Plugin not installed or not added to plugins array.
fix
Run npm install eslint-plugin-eslint-comments --save-dev and ensure 'eslint-comments' is in plugins list.
Definition for rule 'eslint-comments/disable-enable-pair' was not found.
Rules are nested under 'eslint-comments/' namespace; may have used wrong prefix.
fix
Use 'eslint-comments/disable-enable-pair' not 'disable-enable-pair'.
Failed to load plugin 'eslint-comments' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-eslint-comments'
Plugin not installed in the project's node_modules.
fix
npm install eslint-plugin-eslint-comments --save-dev
Upgrade
Version history
3.2.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; plugin components rely on ESLint core APIs.
Agent activity
5 hits · last 30 days
node
4
Resources
eslint-plugin-eslint-comments — npm install eslint-plugin-eslint-comments · libregistry