microsoft / microsoft/TypeScript
JSDoc type reference doesn't skip leading asterisk
Open
Nobody has claimed this yet.
Bug
Domain: JSDoc
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: typescript@3.6.0-dev.20190704
Search Terms:
checkjs
jsdoc
multi-line
multiline
Code
/**
* @returns {
* | 'a'
* | 'b'
* | 'c'
* } - this type is parsed as `any`.
*/
function f() {
return true;
}
Expected behavior:
Error on incompatible return type.
Actual behavior:
No error. The jsdoc return type is parsed as any.
Playground Link:
Not available.
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.
Research direction
Reproduce the issue with the multiline JSDoc @returns example in the report and inspect the TypeScript JSDoc type parsing path. Verify that leading asterisks are skipped and that the incompatible boolean return produces an error instead of treating the type as any.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100