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

fix flow-comments - class type paramters and implements #9897

Merged

Conversation

@tanhauhau
Copy link
Member

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"];

This comment has been minimized.

Copy link
@nicolo-ribaudo

nicolo-ribaudo Apr 26, 2019

Member

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.

This comment has been minimized.

Copy link
@tanhauhau

tanhauhau Apr 26, 2019

Author Member

impls is an array, there's no .remove()
should I clone the node, modify and path.replaceWith(...) with the clone?

This comment has been minimized.

Copy link
@nicolo-ribaudo

nicolo-ribaudo Apr 26, 2019

Member

Oh you can impls.forEach(p => p.remove())

This comment has been minimized.

Copy link
@tanhauhau

tanhauhau Apr 26, 2019

Author Member

I remembered I tried it before, i ended up with class Foo implements {

This comment has been minimized.

Copy link
@nicolo-ribaudo

nicolo-ribaudo Apr 26, 2019

Member

It's ok like this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.