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

switch..case won't indent block statements #486

Closed
braiam opened this issue Jun 27, 2014 · 1 comment
Closed

switch..case won't indent block statements #486

braiam opened this issue Jun 27, 2014 · 1 comment

Comments

@braiam
Copy link

braiam commented Jun 27, 2014

Copying the example from MDN:

var foo = 1;
switch (true) { // invariant TRUE instead of variable foo
    case foo >= 0 && foo <= 3:
        alert('yes');
        break;
    default:
        alert('not');
}

the block inside the brackets is indented (as if/else, function, etc. do) but when parsed this indentation is lost:

var foo = 1;
switch (true) { // invariant TRUE instead of variable foo
case foo >= 0 && foo <= 3:
    alert('yes');
    break;
default:
    alert('not');
}

I recommend flipping the flag that prevents switch blocks from being indented or there was a reason for this?

@einars
Copy link
Contributor

einars commented Jun 27, 2014

Here's some discussion: #15

The web beautifier works with the jslint-happy turned on, I'm not sure if you can get the fat whitespace there.

@einars einars closed this as completed Jun 27, 2014
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