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

Remove return voids #91

Merged
merged 6 commits into from
May 20, 2016
Merged

Remove return voids #91

merged 6 commits into from
May 20, 2016

Conversation

andyfangaf
Copy link
Contributor

@andyfangaf andyfangaf commented May 20, 2016

Fixes pointless else blocks generated by Decaf in #82

/cc @lemonmade @GoodForOneFare

if (
returnStatement.argument.operator === 'void' && returnStatement.argument.argument.raw === '0' ||
returnStatement.argument.name === 'undefined'
) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a check for whether something is undefined or not here: https://github.com/Shopify/javascript/blob/master/packages/shopify-codemod/transforms/coffeescript-soak-to-condition.js#L279-L288, might be worth pulling that out into utils.js and importing it in both spots.

@lemonmade
Copy link
Member

My comments were mostly minor, the bulk of this looks great 👍 Before merging, make sure to add details about this transform in packages/shopify-codemod/README.md, and add it to the list of transforms in packages/esify/index.js.

@andyfangaf
Copy link
Contributor Author

New changes looking good @lemonmade?

@lemonmade
Copy link
Member

Looks like you might have had an issue with the rebase :(

@andyfangaf andyfangaf merged commit 9724daa into master May 20, 2016
@andyfangaf andyfangaf deleted the remove-void-returns branch May 30, 2016 16:18
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.

2 participants