VS Code 工具配置和格式化

时间:2023-03-08 22:36:24
{
"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": " "
}
}

settings.json文件

{
"files.autoSave": "off",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"emmet.syntaxProfiles": {
"vue-html": "html",
"vue": "html"
},
"files.associations": {
"*.vue": "vue"
},
"[vue]": {
"editor.tabSize": 2
},
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"vue"
],
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.stylus": "none",
"vetur.format.defaultFormatter.less": "none"
}