js-beautify indentation of case labels

498 views Asked by At

js-beautify, when used from the command line (latest version, on both Windows and Linux) indents case labels, leading to double indentation of case blocks. I posted this as an issue on github:

https://github.com/einars/js-beautify/issues/367

in reply to which someone correctly pointed out that it actually works properly when you use it via the web interface, which suggests it might be a configuration problem rather than an actual bug in the code.

Does anyone know what's causing this, and whether there's a way to fix it with a configuration tweak?

1

There are 1 answers

4
Stephen Thomas On BEST ANSWER

You should use the option --good-stuff on the command line, e.g.

js-beautify --good-stuff -f test.js