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

empty braces should always collapse to {} on the same line #237

Closed
mitermayer opened this issue Apr 16, 2013 · 2 comments
Closed

empty braces should always collapse to {} on the same line #237

mitermayer opened this issue Apr 16, 2013 · 2 comments

Comments

@mitermayer
Copy link

Empty braces should always collapse. this would fix edge cases like this:

var a = cb || function()
{}

to become this instead:

var a = cb || function(){}

same would be for

var a = 
{}

to become this instead:

var a = {};
bitwiseman added a commit to bitwiseman/js-beautify that referenced this issue Apr 18, 2013
While removing expand-strict, found that brace tests were uneven.
Made all tests appear for all three settings, and adjusted for each.
There are still some minor odd behaviors around empty braces, but they are
non-breaking.

Closes beautifier#236, beautifier#237
bitwiseman added a commit to bitwiseman/js-beautify that referenced this issue Apr 19, 2013
While removing expand-strict, found that brace tests were uneven.
Made all tests appear for all three settings, and adjusted for each.
There are still some minor odd behaviors around empty braces, but they are
non-breaking.

Closes beautifier#236, beautifier#237
@mitermayer
Copy link
Author

@bitwiseman i still have this issue! cant seem to get this:

function(){}

always get this:

function()
{}

@bitwiseman
Copy link
Member

"Still have this issue" - where?

As you can see from https://github.com/bitwiseman/js-beautify/blob/bc62583fd53340edc1e1b7f4911bfbe32b9a2ee5/js/test/beautify-tests.js on line 468, this scenario is covered. So, if you do this from the command-line in master using node or python it should work.

It looks like @einars just did a few commits and merged to the web. Try it again.

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

No branches or pull requests

2 participants