You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * @returns { * | 'a' * | 'b' * | 'c' * } - this type is parsed as `any`. */functionf(){returntrue;}
Expected behavior:
Error on incompatible return type. Actual behavior:
No error. The jsdoc return type is parsed as any. Playground Link:
Not available.
The text was updated successfully, but these errors were encountered:
@orta
That is not true. The { and } are JSDoc's syntax, used as delimiter for type expressions. ref. A valid jsdoc comment looks like this: /** @param {string} - some descriptions. */.
That's because type parsing uses Typescript rules, which have a hacky exemption for asterisks inside jsdoc. But it's clearly not reliable. I'm pretty sure it's because all the tests we added are for object types, which we expected to be formatted like this:
/** * @returns {{ * a: number * }} */
Here, the type starts before the newline-asterisk sequence.
TypeScript Version: typescript@3.6.0-dev.20190704
Search Terms:
checkjs
jsdoc
multi-line
multiline
Code
Expected behavior:
Error on incompatible return type.
Actual behavior:
No error. The jsdoc return type is parsed as
any
.Playground Link:
Not available.
The text was updated successfully, but these errors were encountered: