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-codeVerified import paths — ran on the pinned version, not inferred.
Shows how to configure ESLint with the plugin to error on commented-out code.
Use ESLint disable comments for false positives or adjust the rule severity to 'warn'.
Use // eslint-disable-next-line no-commented-code/no-commented-code or /* eslint-disable no-commented-code/no-commented-code */.
Disable the rule per line or use a different ESLint rule if more granularity is needed.
Ensure eslint-plugin-no-commented-code is installed via npm, and in ESLint config use 'no-commented-code' (without prefix).
Use 'no-commented-code/no-commented-code' as the rule name in ESLint config.
Add 'no-commented-code' to the plugins array in ESLint config.