require-deprecated-tag-description
Require @deprecated tags to explain the deprecation and, ideally, the preferred alternative.
Targeted pattern scopeโ
This rule checks TypeDoc comments containing @deprecated block tags.
What this rule reportsโ
This rule reports @deprecated tags that do not contain meaningful explanatory text.
Why this rule existsโ
TypeDoc renders deprecated members prominently in generated documentation.
An empty deprecation marker tells consumers that an API is going away, but gives them no migration path, replacement, or timeline. That is bad developer experience and creates churn during upgrades.
โ Incorrectโ
/**
* Legacy widget implementation.
* @deprecated
*/
export class LegacyWidget {}
โ Correctโ
/**
* Legacy widget implementation.
* @deprecated Use {@link ModernWidget} instead.
*/
export class LegacyWidget {}
Behavior and migration notesโ
- This rule checks only comments that already contain
@deprecated. - A good deprecation note usually includes either the recommended replacement, the reason for deprecation, or the expected removal timeline.
- This rule does not autofix because deprecation guidance must be written intentionally.
ESLint flat config exampleโ
import typedocPlugin from "eslint-plugin-typedoc";
export default [
{
plugins: { typedoc: typedocPlugin },
rules: {
"typedoc/require-deprecated-tag-description": "error",
},
},
];
When not to use itโ
Disable this rule only if your team intentionally uses bare @deprecated markers without any migration guidance.
Package documentationโ
TypeDoc package documentation:
Further readingโ
Rule catalog ID: R027
Adoption resourcesโ
- Pair with
require-exported-doc-comment-descriptionso deprecated APIs also have a clear lead summary before the migration note. - Pair with
typedoc.configs.markdownwhen your generated docs should provide actionable upgrade guidance instead of bare deprecation banners.