9

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?

2
  • In your issue, you mentioned installing jsbeautify with npm. When I try that, I get a deprecated jsbeautify@0.3.6: This version is not maintained. Please check js-beautify warning. Have you tried installing with pip instead? Dec 15, 2013 at 14:01
  • @StephenThomas Tried with pip just now and it still doesn't work properly, same result.
    – rwallace
    Dec 16, 2013 at 15:23

1 Answer 1

4
+50

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

js-beautify --good-stuff -f test.js
4
  • @rwallace are you planning to give him that bounty?
    – Cilan
    Dec 21, 2013 at 16:37
  • 1
    @ManofSnow yes, didn't realize it hadn't done it when I accepted the answer, done now.
    – rwallace
    Dec 22, 2013 at 14:21
  • @rwallace Close call :)
    – Cilan
    Dec 22, 2013 at 14:32
  • What exactly "good stuff" does? Documentation is unclear (deliberately) Mar 19, 2015 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.