简体   繁体   English

js-beautify案例标签缩进

[英]js-beautify indentation of case labels

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. js-beautify,从命令行使用(最新版本,在Windows和Linux上)缩进大小写标签,导致大小写缩进。 I posted this as an issue on github: 我在github上发布了这个问题:

https://github.com/einars/js-beautify/issues/367 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? 有谁知道是什么导致了这一点,以及是否有办法通过配置调整修复它?

您应该在命令行中使用选项--good-stuff ,例如

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM