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

Improve jsdoc #2103

Merged
merged 1 commit into from
Dec 16, 2023
Merged

Conversation

shadowspawn
Copy link
Collaborator

Pull Request

Problem

I noticed JSDoc type unions are meant to have brackets around them:

This means a value can have one of several types, with the entire list of types enclosed in parentheses and separated by |.

https://jsdoc.app/tags-type

Solution

Add brackets. And fixed a few String/string too.


Related: I noticed Visual Studio Code was not getting the union types consistently right, but I think that is related to TSDoc ignoring the JSDoc union types so not fixed by this change!

API Extractor does not support this {(number|Array)} notation, since its grammar is complex, and the type system it implements is fairly rudimentary compared to TypeScript's.

https://api-extractor.com/pages/tsdoc/tag_returns/

Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shadowspawn shadowspawn merged commit 32c05a8 into tj:release/12.x Dec 16, 2023
6 checks passed
@shadowspawn shadowspawn deleted the feature/better-jsdoc branch December 16, 2023 23:50
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Jan 19, 2024
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants