-
Notifications
You must be signed in to change notification settings - Fork 350
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: parenthesizes around arrow function body returning object #744
Conversation
71d09fb
to
c3507bc
Compare
This seems okay at first glance, but then I don’t understand why it isn’t already handled by this: Lines 500 to 507 in 8cc1f42
|
Looks like it doesn't handled by
(b => {a: 'b'})
|
Looks like this code https://github.com/benjamn/recast/blob/v0.20.3/lib/patcher.ts#L478-L494 returns |
any progress on this? |
Would be amazing to merge this, or fix in any other way, so I don't have to support my own fork of recast accessible by |
Hi, |
Yep, it was me that broke this, and I also have a duplicate issue and a good fix. I'm hoping to get the attention of @benjamn to resolve this, and if not I'm actually more than happy to maintain a fork so one way or another I think we can move forward on this finally! |
I'm also working full time on tooling that will make it significantly easier to develop packages in a decentralized way, that is to say without the single point of failure of maintainers who are the sole holders of publish perms to the central npm repo and whose focus tends to shift for perfectly natural and understandable reasons. |
The issue appears to have been fixed now by #1068, so I believe this PR can be closed. |
Verified this no longer reproduces. Thanks for the nudge, @gnprice. |
Fixes #743. Using
recast
withbabel-parser
andtraverser
break code with arrow function expression returning an object.Code:
Becomes:
After removing function argument from
@babel/traverse
.