Skip to main content

tsdoc-require-2/require-ignore

Require the @ignore 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 @ignore. 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 for exportMode: "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.
*
* @ignore
*/
export function taggedFunction(value: string): string {
return value;
}

When Not To Use It​

Disable this rule if your documentation convention does not require @ignore on the declarations targeted by your configuration.

Further Reading​