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

Work around jscodeshift arrow function bug #114

Merged
merged 1 commit into from
May 1, 2021

Conversation

edsrzf
Copy link
Collaborator

@edsrzf edsrzf commented Apr 30, 2021

recast, a jscodeshift dependency, has an issue (benjamn/recast#743) where re-printed arrow functions returning object literals do not include surrounding parentheses, which means that code gets transformed in an invalid way. (() => {} instead of () => ({}).)

We can work around this issue by re-creating the object literal node, similar to an existing arrow function workaround.

Fixes #113.

recast, a jscodeshift dependency, has an issue where re-printed arrow
functions returning object literals do not include surrounding
parentheses, which means that code gets transformed in an invalid way.

We can work around this issue by re-creating the object literal node,
similar to an existing arrow funciton workaround.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

explicit-any plugin fails to parse arrow function with implicit return of a literal object
2 participants