Skip to main content

require-param-tags

Require @param tags for every parameter in documented declarations.

Targeted pattern scopeโ€‹

This rule inspects documented declarations with parameters, including function declarations, declared functions, and class methods.

What this rule reportsโ€‹

This rule reports documented declarations when one or more parameters are missing corresponding @param tags.

Why this rule existsโ€‹

Parameter names without matching docs create incomplete API documentation and force readers to infer intent from implementation details.

โŒ Incorrectโ€‹

/**
* Build a user profile.
*/
export function buildProfile(name: string, isActive: boolean): string {
return `${name}:${isActive ? "active" : "inactive"}`;
}

โœ… Correctโ€‹

/**
* Build a user profile.
* @param name User display name.
* @param isActive Whether the user is active.
*/
export function buildProfile(name: string, isActive: boolean): string {
return `${name}:${isActive ? "active" : "inactive"}`;
}

Behavior and migration notesโ€‹

Autofix appends missing @param tags with TODO descriptions immediately before the closing */ of the existing comment block.

ESLint flat config exampleโ€‹

import typedocPlugin from "eslint-plugin-typedoc";

export default [
{
plugins: { typedoc: typedocPlugin },
rules: {
"typedoc/require-param-tags": "error",
},
},
];

When not to use itโ€‹

Disable this rule if your team intentionally documents parameters outside of TypeDoc tags and does not rely on generated TypeDoc parameter sections.

Package documentationโ€‹

TypeDoc package documentation:

Further readingโ€‹

Rule catalog ID: R004

Adoption resourcesโ€‹

  • Roll this rule out after require-exported-doc-comment so all relevant declarations already have comment blocks.