{"id":19630,"library":"eslint-doc-generator","title":"eslint-doc-generator","description":"Automatic documentation generator for ESLint plugins and rules v3.3.2 (stable, monthly releases). Generates README rules/configs tables, rule doc titles, notices, and option lists from rule metadata. Key differentiator: eliminates custom documentation scripts and tests by providing a single CLI tool that enforces consistent documentation conventions across ESLint plugins. Supports configurable output formats, badges, emoji suggestions (including AI-powered), and integration with prettier/markdownlint. Ships TypeScript declarations.","status":"active","version":"3.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/eslint-community/eslint-doc-generator","tags":["javascript","doc","docs","documentation","eslint","generator","plugin","typescript"],"install":[{"cmd":"npm install eslint-doc-generator","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-doc-generator","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-doc-generator","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Plugin must be installed alongside the tool; used to load rules and configs","package":"eslint","optional":false},{"reason":"Optional peer dependency for formatted output (line-ending detection)","package":"prettier","optional":true}],"imports":[{"note":"ESM-only since v3 (minimum Node 20). No CommonJS support.","wrong":"const eslintDocGenerator = require('eslint-doc-generator')","symbol":"default","correct":"import eslintDocGenerator from 'eslint-doc-generator'"},{"note":"Named export for programmatic use. ESM only.","wrong":"const { generate } = require('eslint-doc-generator')","symbol":"generate","correct":"import { generate } from 'eslint-doc-generator'"},{"note":"Type-only import for TypeScript; do not import at runtime.","wrong":"import { ESLintDocGeneratorOptions } from 'eslint-doc-generator'","symbol":"ESLintDocGeneratorOptions","correct":"import type { ESLintDocGeneratorOptions } from 'eslint-doc-generator'"}],"quickstart":{"code":"// Install: npm i --save-dev eslint-doc-generator eslint prettier\n\n// ESM usage:\nimport { generate } from 'eslint-doc-generator';\n\n// CLI (programmatic):\nawait generate({\n  cwd: process.cwd(),\n  check: false,\n  configFormat: 'name',\n  ruleDocTitleFormat: 'desc',\n  suggestEmojis: false,\n});\n\n// The CLI also supports direct invocation: eslint-doc-generator --check\nconsole.log('Documentation updated successfully.');\n","lang":"typescript","description":"Shows programmatic usage via generate() with common options and CLI fallback."},"warnings":[{"fix":"Add explicit badge definitions for each config in your configuration file or use --config-badge flag.","message":"v3.0.0 removed implicit config badge fallback. Configs without an explicit badge now show no badge instead of a fallback.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Upgrade to Node.js 20, 22.13.0+, or 24+. Run `nvm install 22` or update your CI Node version.","message":"v3.0.0 dropped support for Node.js <20, <22.13.0 (for 22.x), and <24. Node 18 and below are no longer supported.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Run `eslint-doc-generator` to regenerate rule docs. If you prefer the old format, use `--rule-doc-title-format desc-name`.","message":"v3.0.0 updated default rule doc title format from 'desc-name' to 'desc' (no rule name in title). Notices formatting changed.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure rule meta.deprecated follows the new format (object with `message` and `replacedBy`). If using old flat string, update rules.","message":"v3.3.0 introduced support for new `DeprecatedInfo` format for rule meta.deprecated. Docs may display deprecation info differently.","severity":"breaking","affected_versions":">=3.3.0"},{"fix":"Use `--config-badge` with explicit badge names, or omit to get no badge. For rule count, use `--config-format name` (no count).","message":"v3.0.0 removed the `--config-badge` implicit fallback. The `--config-format` option no longer supports `'ruleCount'` (removed in v2).","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Always run `eslint-doc-generator` without `--check` to regenerate docs, then commit. Use `--check` only in CI to catch staleness.","message":"The tool modifies files in-place. If run with `--check`, it exits with non-zero if docs are outdated, which is intended for CI but may confuse first-time users.","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":"Run `npm install eslint-doc-generator --save-dev` and ensure dependencies are installed.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'eslint-doc-generator'"},{"fix":"Pass a valid directory: `await generate({ cwd: process.cwd() })`.","cause":"Missing `cwd` option when calling generate() programmatically.","error":"Error: The \"path\" argument must be of type string. Received undefined"},{"fix":"Install prettier: `npm install prettier --save-dev` or set `--no-prettier` if using a different formatter.","cause":"Optional peer dependency prettier is missing but required for formatting.","error":"error: Cannot find module 'prettier'"},{"fix":"Use `import` syntax or switch to dynamic `import('eslint-doc-generator')`. Upgrade Node to >=20.","cause":"The package is ESM-only since v3; require() is not supported.","error":"SyntaxError: Invalid or unexpected token (when using require)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}