jsdoc-to-markdown icon indicating copy to clipboard operation
jsdoc-to-markdown copied to clipboard

Nullable/Non-nullable @type is ignored, doesn't generate appropriate output

Open alystair opened this issue 4 years ago • 3 comments

See https://jsdoc.app/tags-type.html#:~:text=about%20each%20property.-,Nullable%20type,-A%20number%20or

Adding ? or ! prior to a type should modify the outputted documentation, currently @type {?boolean} doesn't output boolean | null, just boolean.

alystair avatar Nov 26 '21 00:11 alystair

Could you post a reproduction case please - a failing example I can run to see the issue.. thanks

75lb avatar Dec 01 '21 09:12 75lb

test.js

/** @type {!boolean} */
const foo = false;
/** Foo bar bazz
 * @type {?boolean} */
const bar = foo ? null : true;
console.log(bar);

then ran npx jsdoc-to-markdown --files test.js > test.md

alystair avatar Dec 01 '21 22:12 alystair

Have not heard a response in a while - is this shorthand under active consideration or should I replace all instances to use { X | null } style JSDOC?

alystair avatar Mar 27 '22 23:03 alystair