-
-
Notifications
You must be signed in to change notification settings - Fork 4
Fix to add MapFunction
type back
#7
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
Conversation
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.
Thanks @JounQin!
Code looks fine, it may be worth waiting for a resolution on #6 (comment) before moving forward with this.
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.
Cool that this works from an index.js
. I didn’t know that.
Can you remove from in the readme as well?unist-util-map/complex-types.d.ts
For later, optional improvements:
- This line should be
parent: Extract<InclusiveDescendant<Tree>, Parent> | undefined
I think! - Actual tests for the generics might be useful, such as of like this: https://github.com/syntax-tree/unist-util-filter/blob/main/index.test-d.ts
|
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.
Thanks for your hard work! Looks good to me, if other people think it’s fine to add TS 4.5+ syntax: #6 (comment)
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.
I think it's good to try and stick to the DefinitelyTyped support window (unless it's really inconvenient). However, I believe this only requires TypeScript 4.5 to build the types from JSDoc right? Since the types can still be consumed using the same TypeScript versions, it's non-breaking.
@remcohaszing i was thinking that first, but without skipLibCheck, I was thinking maybe they'd get checked anyway? |
Nope, TypeScript only looks at the |
MapFunction
type back
Initial checklist
Description of changes
close #6