Skip to content

TS v5.4.2 errors on referencing a property delete in JSDoc @link or @linkcode #57738

Description

@jaydenseric

🔎 Search Terms

"jsdoc link keyword delete", "Identifier expected. 'delete' is a reserved word that cannot be used here. ts(1359)"

🕗 Version & Regression Information

  • This changed between versions 5.3.3 and 5.4.2

The bug was not present in TS v5.3.3; upgrading to v5.4.2 exhibits the problem.

⏯ Playground Link

https://www.typescriptlang.org/play?moduleResolution=99&target=99&jsx=0&module=199&ssl=3&ssc=26&pln=1&pc=1&filetype=js#code/PTAEAEBcGcFoGMAWBTeBrAUB4AqHoBvcAGwEsA7NUAWQEMAHAOgBNljlJkBfUHYIA

💻 Code

// @ts-check

/** {@link Map.delete} */

🙁 Actual behavior

A TypeScript error on the delete in the JSDoc @link:

Identifier expected. 'delete' is a reserved word that cannot be used here. ts(1359)

🙂 Expected behavior

No TypeScript error, and the delete in the JSDoc @link should have hover information.

Additional information about the issue

Mentioned this bug here:

#53111 (comment)

graphql-react users who upgrade TypeScript in their projects to v5.4.2 suddenly start seeing TypeScript errors wherever imported graphql-react modules have a JSDoc @link referencing a property delete, e.g:

https://github.com/jaydenseric/graphql-react/blob/5525aca4e5ba5aad5115e56de92bf5ab4acbd2c9/cacheDelete.mjs#L11

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions