-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
lib: add JSDoc typings for util #38213
Conversation
No need to fix all the checkJs errors for now! it is going to be an iterative process that will get easier as more types are added throughout core. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits but LGTM
Co-authored-by: Bradley Farias <[email protected]>
Co-authored-by: Bradley Farias <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of the util
functions are deprecated.
Should we use jsdoc's @deprecated
tag to mark them as such?
Added |
It is supported by TypeScript but the goal of JSDoc in core files is not to duplicate the public-facing documentation. Maybe it's fine in this case, because we don't use these functions in core, but we have to be careful about this (avoid too much duplication, focus on typings and other small changes that help core developers). |
PR-URL: #38213 Refs: #38182 Refs: https://twitter.com/bradleymeck/status/1380643627211354115 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 767d91b |
PR-URL: #38213 Refs: #38182 Refs: https://twitter.com/bradleymeck/status/1380643627211354115 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #38213 Refs: #38182 Refs: https://twitter.com/bradleymeck/status/1380643627211354115 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #38213 Refs: #38182 Refs: https://twitter.com/bradleymeck/status/1380643627211354115 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #38213 Refs: #38182 Refs: https://twitter.com/bradleymeck/status/1380643627211354115 Reviewed-By: Bradley Farias <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Ref: #38182
Ref: https://twitter.com/bradleymeck/status/1380643627211354115
Added JSDoc typings to
lib/util
. Most of the typings are pretty simple and direct, all theisThing
methods have been typed using type predicates.callbackify
is a bit complex, for this I used the new Leading Rest elements in tuple types to infer types.Before:
After:
There are still some errors with
checkJs
enabled that I'm not sure how to fix since we are mutating the original type: