Skip to content

TS error when JSDoc @see tag starts with an inline @linkcode tag #47261

@jaydenseric

Description

@jaydenseric

Bug Report

TS incorrectly errors when a JSDoc @see tag starts with an inline @linkcode tag.

🔎 Search Terms

  • jsdoc
  • @see
  • @linkcode

🕗 Version & Regression Information

Tested with typescript v4.5.4 and v4.6.0-dev.20211228 and the bug is present in both versions.

⏯ Playground Link

Playground link with relevant code

💻 Code

// @ts-check

/**
 * @typedef {any} A
 */

/**
 * @see {@link A}
 * @see {@linkcode A}
 */
let b;

🙁 Actual behavior

There is a TS error:

Identifier expected.ts(1003)

Screen Shot 2021-12-29 at 2 44 17 pm

Screen Shot 2021-12-29 at 2 40 52 pm

🙂 Expected behavior

No TS error, and the @linkcode should render correctly within intellisense as an inline code link.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions