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

do-while semicolon #678

Closed
bounceme opened this issue Nov 9, 2016 · 5 comments

Comments

@bounceme
Copy link

commented Nov 9, 2016

mishoo/UglifyJS2#893

I think that the do-while is a exception and should have a semicolon to prevent inconsistent behaviour and dev confusion

@feross

This comment has been minimized.

Copy link
Member

commented Nov 23, 2016

Thanks for the issue, @bounceme. I don't have time to read that entire issue. Can you clarify what exactly you're proposing we do?

@bounceme

This comment has been minimized.

Copy link
Author

commented Nov 23, 2016

the semicolon is only necessary (browsers may behave differently) when not followed by a newline or } . I don't expect that that breaks a lot of code because I see it often, but I find it easier to tell whether the following lines are the while statements or not when the semicolon is there. it draws attention being either a null loop's semicolon, or the end of a do-while

@bounceme

This comment has been minimized.

Copy link
Author

commented Nov 23, 2016

if it is configurable with eslint, i think that missing a semi should give a warning

@feross

This comment has been minimized.

Copy link
Member

commented Nov 23, 2016

There isn't an ESLint rule to enforce what you're asking for, so I'm going to close this issue.

@feross feross closed this Nov 23, 2016

@dcousens

This comment has been minimized.

Copy link
Member

commented Nov 23, 2016

@bounceme maybe open an eslint issue for it?
(also, examples help)

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

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