Skip to content

Many errors on JSDoc use entire tag as errorNode #41974

Open
@sandersn

Description

@sandersn

This is made more obvious by #41877, which corrects the spans of tags to their full spans, making the error spans even more ungainly. Here's one example; see the errors.txt diffs in the linked PR for more.

Expected behavior:

    /** @type {Gioconda} */
        ~~~~~~~~~~~~~~~~ // before #41877
        ~~~~~~~~~~~~~~~~~ // after #41877 (both are wrong)
!!! error TS8030: The type of a function declaration must match the function's signature.
    function monaLisa(sb) {
        return typeof sb === 'string' ? 1 : 2;
    }

Actual behavior:

    /** @type {Gioconda} */
               ~~~~~~~~
!!! error TS8030: The type of a function declaration must match the function's signature.
    function monaLisa(sb) {
        return typeof sb === 'string' ? 1 : 2;
    }

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions