{"id":27724,"library":"eslint-plugin-comment-length","title":"eslint-plugin-comment-length","description":"ESLint plugin limiting comment line length to improve readability. Version 2.3.1, maintained, actively updated. Provides rules like 'comment-length/max-len' and 'comment-length/reflow' to enforce max length in comments, including options for block vs line comments. Works with ESLint >=8.0.0, ships TypeScript types. Key differentiator: focuses solely on comment formatting, unlike general max-len rules which affect code.","status":"active","version":"2.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/lasselupe33/eslint-plugin-comment-length","tags":["javascript","eslint","eslintplugin","max-len","comments","reflow","typescript"],"install":[{"cmd":"npm install eslint-plugin-comment-length","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-comment-length","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-comment-length","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin is an ESLint plugin and requires ESLint >=8.0.0","package":"eslint","optional":false}],"imports":[{"note":"ESLint plugins are typically imported as default and added to 'plugins' array. Requires ESLint >=8.0.0.","wrong":"const plugin = require('eslint-plugin-comment-length')","symbol":"default","correct":"import plugin from 'eslint-plugin-comment-length'"},{"note":"Named export for rules is available for advanced usage like custom rule mapping.","wrong":"","symbol":"rules","correct":"import { rules } from 'eslint-plugin-comment-length'"},{"note":"Exported config presets (e.g. 'recommended') for easy setup.","wrong":"","symbol":"configs","correct":"import { configs } from 'eslint-plugin-comment-length'"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  plugins: ['comment-length'],\n  rules: {\n    'comment-length/max-len': ['error', { maxLen: 80, commentsOnly: true }],\n    'comment-length/reflow': ['error', { maxLen: 80, autoFix: true }]\n  }\n};","lang":"javascript","description":"Configures ESLint to enforce max line length in comments (80 chars) and auto-fix comment reflow, using the comment-length plugin."},"warnings":[{"fix":"Update rule names to include the plugin prefix 'comment-length/'","message":"v2.0.0 changed rule names from 'max-len' to 'comment-length/max-len'","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Update to v2.3.1: npm install eslint-plugin-comment-length@latest","message":"v1.x.x is deprecated and no longer supported; upgrade to v2.x.x","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Review auto-fix changes before applying; consider using 'suggest' mode first","message":"The 'reflow' rule auto-fixes comments which may alter visual alignment; use with caution","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure ESLint version is 8 or higher","message":"ESLint >=8.0.0 required; does not work with ESLint <8","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run: npm install eslint-plugin-comment-length --save-dev","cause":"Plugin not installed in local node_modules; missing dependency","error":"Error: Failed to load plugin 'comment-length': Cannot find module 'eslint-plugin-comment-length'"},{"fix":"Use: 'comment-length/max-len': ['error', { maxLen: 80, commentsOnly: true }]","cause":"Misplaced rule options; rule config must be an array with severity and options object","error":"Configuration for rule 'comment-length/max-len' is invalid: Value [\"error\", {\"maxLen\": 80, \"commentsOnly\": true}] is not an array"},{"fix":"Use require syntax for CommonJS or install babel-eslint for ES modules","cause":"Using import syntax without proper parser (e.g. babel-eslint) or in CommonJS file","error":"Parsing error: The keyword 'import' is reserved"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}