tsdoc-require-2/require-param
Require the @param tag in TSDoc blocks for targeted declarations.
Rule detailsâ
This rule reports declarations that already have TSDoc but are missing @param.
It does not create a TSDoc block. Pair it with tsdoc-require-2/require when you also want to require comments.
Why use itâ
@param documents input meaning and reduces ambiguity at call sites.
Optionsâ
This rule supports the same options as tsdoc-require-2/require:
enforceForexportModeincludeNonExported(legacy alias forexportMode: "all")
Flat config example (function-focused scope):
import tsdocRequire from "eslint-plugin-tsdoc-require-2";
export default [
{
plugins: {
"tsdoc-require-2": tsdocRequire,
},
rules: {
"tsdoc-require-2/require-param": [
"error",
{
enforceFor: ["function"],
},
],
},
},
];
Examplesâ
â Incorrectâ
/**
* Converts input to a stable ID.
*/
export function toStableId(value: string): string {
return value.trim().toLowerCase();
}
â Correctâ
/**
* Converts input to a stable ID.
*
* @param value - Raw identifier input.
*/
export function toStableId(value: string): string {
return value.trim().toLowerCase();
}
Behavior notesâ
This rule checks tag presence. It does not validate one @param entry per function parameter.