-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fix flow-comments - class type paramters and implements #9897
fix flow-comments - class type paramters and implements #9897
Conversation
tanhauhau
commented
Apr 24, 2019
Q | A |
---|---|
Fixed Issues? | Fixes #5626 |
Patch: Bug Fix? | |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
.map(impl => generateComment(impl).replace(/^:: /, "")) | ||
.join(", "), | ||
); | ||
delete node["implements"]; |
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.
Doesn't impls.remove()
work? It's better not to mutate the ast directly, since path
methods sometimes do some clean up when mutating nodes.
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.
impls
is an array, there's no .remove()
should I clone the node, modify and path.replaceWith(...)
with the clone?
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.
Oh you can impls.forEach(p => p.remove())
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 remembered I tried it before, i ended up with class Foo implements {
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.
It's ok like this then.