Registry / testing / eslint-plugin-no-commented-code

eslint-plugin-no-commented-code

JSON →
library1.0.10jsnpmunverified

An ESLint plugin that disallows commented-out code in JavaScript and TypeScript files. Version 1.0.10 is the current stable release with no active development cadence. It differentiates valid comments from commented-out code by detecting code patterns (e.g., imports, function definitions, expressions) within comments. Works as a standalone rule without additional configuration, making it lightweight. Primarily maintained by a single contributor with infrequent updates.

npm install eslint-plugin-no-commented-code
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-NO-C
E
eslint-plugin-no-commented-code
testingjavascriptv1.0.10
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

no-commented-code
✓ plugins: ['no-commented-code']
✗ eslint-plugin-no-commented-code (wrong plugin name format; ESLint expects the 'eslint-plugin-' prefix to be omitted in config)
In .eslintrc.* files, the plugin name must be 'no-commented-code' (without the 'eslint-plugin-' prefix).
no-commented-code/no-commented-code
✓ rules: { 'no-commented-code/no-commented-code': 'error' }
✗ rules: { 'no-commented-code': 'error' } (missing plugin prefix)
Rule names must include the plugin namespace, e.g., 'no-commented-code/no-commented-code'.
require('eslint-plugin-no-commented-code')
✓ const plugin = require('eslint-plugin-no-commented-code')
For CommonJS ESLint configs. The plugin does not provide a default export for direct rule use.

Shows how to configure ESLint with the plugin to error on commented-out code.

// Install: npm install eslint eslint-plugin-no-commented-code --save-dev // .eslintrc.js module.exports = { plugins: ['no-commented-code'], rules: { 'no-commented-code/no-commented-code': 'error' } };
Debug
Known issues
gotchaThe rule may flag comments containing code-like strings that are not actually executable code, such as JSON examples or pseudocode.
fix
Use ESLint disable comments for false positives or adjust the rule severity to 'warn'.
affects: >=1.0.0
gotchaWhen using eslint-disable comments to bypass the rule, ensure they are placed correctly; the rule's disable comment uses 'no-commented-code/no-commented-code' (not 'no-commented-code').
fix
Use // eslint-disable-next-line no-commented-code/no-commented-code or /* eslint-disable no-commented-code/no-commented-code */.
affects: >=1.0.0
gotchaThe rule is applied globally; you cannot configure it to allow certain patterns (e.g., commented-out test code).
fix
Disable the rule per line or use a different ESLint rule if more granularity is needed.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'no-commented-code'
ESLint cannot find the plugin because it is not installed or the plugin name is incorrect.
fix
Ensure eslint-plugin-no-commented-code is installed via npm, and in ESLint config use 'no-commented-code' (without prefix).
Configuration for rule 'no-commented-code' is invalid: Unknown rule.
Referencing the rule without the plugin namespace.
fix
Use 'no-commented-code/no-commented-code' as the rule name in ESLint config.
Definition for rule 'no-commented-code/no-commented-code' was not found.
The plugin is not loaded in ESLint config; missing 'plugins' section.
fix
Add 'no-commented-code' to the plugins array in ESLint config.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin to function
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-no-commented-code — npm install eslint-plugin-no-commented-code · libregistry