tsdoc-require-2/require-property
Require the @property tag in TSDoc blocks for supported TypeScript declarations.
Rule Detailsâ
This rule reports supported declarations and default exports when a TSDoc block exists but does not contain @property. It does not create the TSDoc block itself, so pair it with tsdoc-require-2/require when you also want to require the comment.
Optionsâ
This rule accepts the same options as tsdoc-require-2/require:
-
enforceFor: limit which declaration kinds are checked. -
exportMode: choose whether to check exported declarations, non-exported top-level declarations, or both. -
includeNonExported: legacy alias forexportMode: "all".type Options = [{enforceFor?: Array<| "class"| "enum"| "function"| "interface"| "namespace"| "object"| "type"| "variable">;exportMode?: "all" | "exported" | "non-exported";includeNonExported?: boolean;},];Default options:
[{enforceFor: ["class","enum","function","interface","namespace","object","type","variable",],exportMode: "exported",},];
â Incorrectâ
/**
* Performs a tagged operation.
*/
export function taggedFunction(value: string): string {
return value;
}
â Correctâ
/**
* Performs a tagged operation.
*
* @property
*/
export function taggedFunction(value: string): string {
return value;
}
When Not To Use Itâ
Disable this rule if your documentation convention does not require @property on the declarations targeted by your configuration.