Skip to content

no-restated-jsdoc

Flag JSDoc prose that appears to repeat declaration names without adding behavioral information.

Why

Signature-only JSDoc duplicates type information and drifts without helping callers.

Fix

Delete the block or document behavior, constraints, failures, or context the signature cannot express.

Examples

Before — flagged Remove JSDoc that only repeats the signature
src/users.ts
/** Get the user by id. */
export function getUserById(id: string) {
return id;
}
After — preferred Document behavior absent from the signature
src/users.ts
/** Get the user while bypassing the read replica. */
export function getUser(id: string) {
return id;
}
Before — flagged Review prose that merely repeats the declaration name
src/users.ts
/** Cache the user. */
export function cacheUser(user: unknown) {
return user;
}
After — preferred Keep behavior even when its words resemble the declaration
src/users.ts
/** Does not cache the user. */
export function cacheUser(user: unknown) {
return user;
}

Formerly: jsdoc-restates-signature