Sass 防止js美化添加额外的空白/空行
js beautify(在VSCode下使用)在注释后添加了额外的行,这让我很恼火: 我的sample.scssSass 防止js美化添加额外的空白/空行,sass,whitespace,js-beautify,Sass,Whitespace,Js Beautify,js beautify(在VSCode下使用)在注释后添加了额外的行,这让我很恼火: 我的sample.scss /* a fancy comment */ .foo-bars { background: $gray; display: block; width: 26px !important; } …变成 /* a fancy comment */ <-- annoying empty line inserted
/* 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;
}
更新:仅影响
/*块注释*/
,而不影响//行注释
这似乎应该得到修复(),但由于此问题仍然存在未解决和挂起的问题,因此没有按预期解决
正如您提到的,您现在可以使用
//line comments
作为解决方法。在CSS中使用//
进行注释是不标准的,会导致问题,不鼓励使用
{
"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
}