【发布时间】:2017-04-20 11:19:33
【问题描述】:
js-beautify(在 VSCode 下使用)通过在 cmets 后面添加额外的行让我很恼火:
我的示例.scss
/* a fancy comment */
.foo-bars {
background: $gray;
display: block;
width: 26px !important;
}
...变成...
/* a fancy comment */
<-- annoying empty line inserted
.foo-bars {
background: $gray;
display: block;
<--- (this is fine. I like it being preserved)
width: 26px !important;
}
这是我的.jsbeautifyrc(已验证有效,即通过"indent_char": "#" 进行测试)
{
"indent_char": " ",
"preserve_newlines": true,
"max_preserve_newlines": 8,
"keep-array-indentation": true,
"break_chained_methods": false,
"newline_between_rules": false,
"selector_separator_newline": false,
"end_with_newline": false
}
更新:仅影响/* block comments */,不影响// line comments。
【问题讨论】:
标签: sass whitespace js-beautify