Skip to main content

tsdoc-require-2/require-sealed

Require the @sealed tag in TSDoc blocks for exported declarations.

Rule details​

By default, this rule reports exported declarations (and supported default exports) that have TSDoc but are missing @sealed. Set includeNonExported: true to also check non-exported top-level declarations.

It supports the same options as tsdoc-require-2/require:

  • enforceFor: choose which declaration kinds are checked.
  • includeNonExported: when true, also check non-exported top-level declarations (default: false).

Options​

{
"rules": {
"tsdoc-require-2/require-sealed": [
"error",
{
"enforceFor": [
"class",
"function",
"interface",
"type",
"enum",
"variable",
"object"
]
}
]
}
}

Examples​

❌ Incorrect​

/**
* Performs a task.
*/
export function runTask(value: string): string {
return value;
}

✅ Correct​

/**
* Performs a task.
*
* @sealed
*/
export function runTask(value: string): string {
return value;
}

Further reading​