Open ghost opened 7 years ago
well.. that means it is an error to have this JSDoc.
if we report this, why not report other things in jsdoc as well.. like invalid tags @params
instead of @param
...
I think this is subsumed by https://github.com/Microsoft/TypeScript/issues/13371
closing in favor of #13371
Let's use this issue to track semantic errors for jsdoc. #13371 tracks syntactic errors.
There is still the open question of whether these errors (and associated quick fixes) should only be availble in js files with // @ts-check
or in TS files as well.
Might there be optional report of missing JSDoc @param
and @return
?
And how about detection of a mismatch between actual return
and @return
/@returns
?
@brettz9 Enable "checkJs": true
inside compilerOptions
in your tsconfig.json
and you should get an error if a @return
tag is incorrect.
/** @return {number} */
function g() { return ""; } // Error
Enable "noImplicitAny": true
(or better, "strict": true
) and you will get an error if a @param
tag is missing.
function f(x) {} // Error, 'x' is implicitly 'any'
TypeScript Version: nightly (2.4.0-dev.20170515)
Code
Expected behavior:
Can fix spelling for either
abcdeg
.Actual behavior:
Does not work in jsdoc.