{"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,"search_vec":"'1.0.10':21 'activ':29 'addit':58 'cadenc':31 'code':5,14,40,43,82 'comment':4,12,35,38,51,81 'commented-out':11,37 'configur':59 'contributor':68 'current':24 'definit':48 'detect':42 'develop':30 'differenti':33 'disallow':10 'e.g':45 'eslint':1,7,73,75,78 'eslint-plugin':74 'eslint-plugin-no-commented-cod':77 'express':49 'file':19 'function':47 'import':46 'infrequ':70 'javascript':16,72 'lightweight':62 'maintain':64 'make':60 'pattern':44 'plugin':2,8,76,79 'primarili':63 'releas':26 'rule':56 'singl':67 'stabl':25 'standalon':55 'typescript':18 'updat':71 'valid':34 'version':20 'within':50 'without':57 'work':52","created_at":"2026-04-25T11:19:59.124696+00:00","updated_at":"2026-04-25T11:19:59.124696+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/fernandotonon/eslint-plugin-no-commented-code","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-no-commented-code","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}