vscode保存时自动保存的格式问题
保存时自动保存的格式问题
最近vscode出现了保存时自动加分号的问题(配置并不是如此),出现这样的问题多半是因为 JS-CSS-HTML Formatter 这个插件更新造成的,应做以下配置:
1.在项目中的 .vscode文件夹下创建formatter.json文件(该文件是用来配置JS-CSS-HTML Formatter的)
2.在里面写下你要的配置,如:
{
"onSave": true,
"javascript": {
"indent_size": 2,
"indent_char": " ",
"eol": "auto",
"preserve_newlines": true,
"break_chained_methods": false,
"max_preserve_newlines": 0,
"space_in_paren": false,
"space_in_empty_paren": false,
"jslint_happy": false,
"space_after_anon_function": false,
"keep_array_indentation": false,
"space_before_conditional": true,
"unescape_strings": false,
"wrap_line_length": 0,
"e4x": false,
"end_with_newline": true,
"comma_first": false,
"brace_style": "preserve-inline"
},
"css": {
"indent_size": 2,
"indentCharacter": " ",
"indent_char": " ",
"selector_separator_newline": true,
"end_with_newline": true,
"newline_between_rules": true,
"eol": "\n"
},
"html": {
"indent_inner_html": false,
"end_with_newline": true,
"indent_size": 2,
"indent_char": " ",
"indent_character": " "
}
}