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

Add JSDoc typeof support via JSDoc plugin #5882

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

kungfooman
Copy link
Collaborator

We had many issues around typeof and at some point simply settled on... the wrong type.

This caused a trail of ts-ignore comments, but I never realized that JSDoc has a plugin for exactly this issue: jsdoc-typeof-plugin

So this PR simply integrates that plugin and since now we have a correct type, we can let go of maaany ts-ignore comments.

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

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

This is cool. Thanks!

@willeastcott willeastcott added the docs Documentation related label Dec 6, 2023
@willeastcott willeastcott merged commit 201cbc0 into playcanvas:main Dec 6, 2023
7 checks passed
@mvaligursky
Copy link
Contributor

Yes, fantastic find!
I think there are few more as well in those app create options .. for example lightmapper and batcher should be typeof, as we pass in type, and not the instance.

@Maksims
Copy link
Collaborator

Maksims commented Dec 6, 2023

PR's with more lines removed than added - best PR's 🙏

@kungfooman
Copy link
Collaborator Author

I think there are few more as well in those app create options .. for example lightmapper and batcher should be typeof, as we pass in type, and not the instance.

Yep, absolutely, I thought we could chip away at it one piece at a time (to keep PR size non-overwhelming/reviewable).

If we make some fire under #5574 we can also remove lots of ts-ignore's again (currently it's not possible, because it's considered @interface while typeof requires a "real" class).

@kungfooman kungfooman deleted the jsdoc-typeof-support branch December 7, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants