Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alystair opened this issue Nov 26, 2021 · 3 comments

Comments

@alystair
Copy link

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 alystair changed the title Nullable/Non-nullable @type does not generate appropriate documentation Nullable/Non-nullable @type is ignored, doesn't generate appropriate output Nov 26, 2021
@75lb
Copy link
Member

75lb commented Dec 1, 2021

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

@alystair
Copy link
Author

alystair commented Dec 1, 2021

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants