{"id":19848,"library":"eslint-plugin-no-commented-code","title":"ESLint Plugin No Commented Code","description":"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.","status":"active","version":"1.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/fernandotonon/eslint-plugin-no-commented-code","tags":["javascript","eslint","eslint-plugin","eslint-plugin-no-commented-code"],"install":[{"cmd":"npm install eslint-plugin-no-commented-code","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-no-commented-code","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-no-commented-code","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to function","package":"eslint","optional":false}],"imports":[{"note":"In .eslintrc.* files, the plugin name must be 'no-commented-code' (without the 'eslint-plugin-' prefix).","wrong":"eslint-plugin-no-commented-code (wrong plugin name format; ESLint expects the 'eslint-plugin-' prefix to be omitted in config)","symbol":"no-commented-code","correct":"plugins: ['no-commented-code']"},{"note":"Rule names must include the plugin namespace, e.g., 'no-commented-code/no-commented-code'.","wrong":"rules: { 'no-commented-code': 'error' } (missing plugin prefix)","symbol":"no-commented-code/no-commented-code","correct":"rules: { 'no-commented-code/no-commented-code': 'error' }"},{"note":"For CommonJS ESLint configs. The plugin does not provide a default export for direct rule use.","wrong":null,"symbol":"require('eslint-plugin-no-commented-code')","correct":"const plugin = require('eslint-plugin-no-commented-code')"}],"quickstart":{"code":"// Install: npm install eslint eslint-plugin-no-commented-code --save-dev\n// .eslintrc.js\nmodule.exports = {\n  plugins: ['no-commented-code'],\n  rules: {\n    'no-commented-code/no-commented-code': 'error'\n  }\n};","lang":"javascript","description":"Shows how to configure ESLint with the plugin to error on commented-out code."},"warnings":[{"fix":"Use ESLint disable comments for false positives or adjust the rule severity to 'warn'.","message":"The rule may flag comments containing code-like strings that are not actually executable code, such as JSON examples or pseudocode.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use // eslint-disable-next-line no-commented-code/no-commented-code or /* eslint-disable no-commented-code/no-commented-code */.","message":"When 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').","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Disable the rule per line or use a different ESLint rule if more granularity is needed.","message":"The rule is applied globally; you cannot configure it to allow certain patterns (e.g., commented-out test code).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure eslint-plugin-no-commented-code is installed via npm, and in ESLint config use 'no-commented-code' (without prefix).","cause":"ESLint cannot find the plugin because it is not installed or the plugin name is incorrect.","error":"Error: Failed to load plugin 'no-commented-code'"},{"fix":"Use 'no-commented-code/no-commented-code' as the rule name in ESLint config.","cause":"Referencing the rule without the plugin namespace.","error":"Configuration for rule 'no-commented-code' is invalid: Unknown rule."},{"fix":"Add 'no-commented-code' to the plugins array in ESLint config.","cause":"The plugin is not loaded in ESLint config; missing 'plugins' section.","error":"Definition for rule 'no-commented-code/no-commented-code' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}