require-package-documentation-description
Require top-level @packageDocumentation comments to include descriptive prose.
Targeted pattern scopeโ
This rule checks exporting modules that already have a package-level TypeDoc comment.
What this rule reportsโ
This rule reports package documentation blocks that contain only the tag and no meaningful description text.
Why this rule existsโ
A bare package tag without explanatory prose adds little value to generated docs. Modules should explain what the exported API is for.
โ Incorrectโ
/**
* @packageDocumentation
*/
export function add(left: number, right: number): number {
return left + right;
}
โ Correctโ
/**
* @packageDocumentation
* Public API helpers for parsing values.
*/
export function add(left: number, right: number): number {
return left + right;
}
Behavior and migration notesโ
This rule intentionally does not autofix because module descriptions should be written intentionally.
ESLint flat config exampleโ
import typedocPlugin from "eslint-plugin-typedoc";
export default [
{
plugins: { typedoc: typedocPlugin },
rules: {
"typedoc/require-package-documentation-description": "error",
},
},
];
When not to use itโ
Disable when package-level descriptions are intentionally managed elsewhere.
Package documentationโ
TypeDoc package documentation:
Further readingโ
Rule catalog ID: R023
Adoption resourcesโ
- Use alongside
require-package-documentationandprefer-package-documentation-tagfor package-doc quality.