Skip to content

@template tag documentation not validated for classes #3031

@shannon

Description

@shannon

Search terms

@template validation constructor

Expected Behavior

Typedoc validation should not warn about lack of documentation on TypeParameter defined at the class level.

Actual Behavior

Typedoc warns that the TypeParameter is not documented when it is in fact documented using a @template tag.

typedoc
[warning] Test.constructor.T (TypeParameter), defined in <unknown>/<path>/test-template.js, does not have any documentation
[warning] Found 0 errors and 1 warnings

The actual resulting documentation includes the description so I believe it understands the syntax, it's just the validation warning that is not correct. For completeness I tried the @typeParam tag instead and it does not result in the warning but this tag is not recognized by other tools that I am using so it's not an option really.

Steps to reproduce the bug

Run typedoc against the following file:

//test-template.js
/**
 * Test for Type Parameters on Constructor Signatures being ignored.
 *
 * @template T - This is documentation for T
 */
export class Test {

}

With the following config:

//typedoc.config.js
const config = {
    name: "Documentation",
    entryPoints: ["./test-template.js"],
    out: "doc",
    compilerOptions: {
        checkJs: true,
        target: 'esnext',
        module: 'esnext',
        moduleResolution: 'node',
    },
    skipErrorChecking: true,
    validation: {
        notDocumented: true,
    },
    requiredToBeDocumented: [
        "Constructor",
        "TypeParameter"
    ]
};

export default config;

Environment

  • TypeDoc version: 0.28.14
  • TypeScript version: 5.8.3
  • Node.js version: v22.15.0
  • OS: Both Windows and Ubuntu

Edit: It actually doesn't even need the constructor to be included, so I simplified the reproducer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions