microsoft / microsoft/TypeScript
`'X' only refers to a type` error in JSDoc comments
Open
@gabritto is already working on this.
Since Jul 24, 2024.
Bug
Domain: check: Error Instability
Needs Human Review
Needs More Info
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
🔎 Search Terms
- JSDoc
- only refers to a type
@link
🕗 Version & Regression Information
5.6.0-dev.20240723
Not a regression
⏯ Playground Link
No response
💻 Code
When editing JSDoc comments that use @link, I occasionally see errors such as:
'TextDocument' only refers to a type, but is being used as a value here.ts(2693)
This seems to happen most often in larger projects, such as the VS Code codebase
As soon as I make another edit, the error goes away
Attached log shows the error showing up and then going away once an edit is made: tsserver.log
🙁 Actual behavior
Transient errors are occasionally reported. Seems to happen most often when editing jsdoc comments
🙂 Expected behavior
No error. The code is valid
Additional information about the issue
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.