Skip to content

unused type parameter message is wrong for jsdoc @template #32843

Closed
@sandersn

Description

@sandersn
/**
 * @template {string} K
 * @template V
 */
class MM {
    constructor() {
        /** @type {V} */
        this.t;
    }
}

Expected behavior:
Message: "K is declared but its value is never read"

Actual behavior:
Message: "All type parameters are unused."

Note that the message is the same if K comes second. The code in checkUnusedTypeParameters looks suspicious where it tries to handle template tags, so it's probably just wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationDomain: Quick FixesEditor-provided fixes, often called code actions.Good First IssueWell scoped, documented and has the green light

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions