vscode settings.json
{
"window.zoomLevel": 1,
"workbench.colorTheme": "Default Light+",
"eslint.run": "onSave",
"eslint.migration.2_x": "off",
"eslint.options": {
"extensions": [".js", ".vue"]
},
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"html",
"typescript",
"typescriptreact"
],
"eslint.format.enable": true,
"eslint.codeAction.showDocumentation": {
"enable": true
},
"editor.detectIndentation": true,
"editor.insertSpaces": false,
"editor.tabSize": 2,
"editor.fontSize": 14,
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.unicodeHighlight.ambiguousCharacters": false,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.quickSuggestions": {
"strings": true
},
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
"javascript.preferences.quoteStyle": "single",
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
/* prettier的配置 */
"prettier.trailingComma": "none",
"prettier.semi": false, // 句尾添加分号
"prettier.singleQuote": true, // 使用单引号代替双引号
"prettier.arrowParens": "avoid", // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号
"prettier.bracketSpacing": true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }"
"prettier.endOfLine": "auto", // 结尾是 \n \r \n\r auto
"prettier.htmlWhitespaceSensitivity": "ignore",
"prettier.jsxSingleQuote": true, // 在jsx中使用单引号代替双引号
"prettier.requireConfig": false, // Require a 'prettierconfig' to format prettier
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"[js]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.ts": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
// "wrap_attributes": "force-expand-multiline",
"js-beautify-html": {
// "wrap_attributes": "force-expand-multiline",
// "end_with_newline": false
// "wrap_line_length": 120,
// "wrap_attributes": "auto"
// #vue组件中html代码格式化样式
// - auto: 仅在超出行长度时才对属性进行换行。
// - force: 对除第一个属性外的其他每个属性进行换行。
// - force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。
// - force-expand-multiline: 对每个属性进行换行。
// - aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。
}
// "prettyhtml": {
// "printWidth": 100,
// "singleQuote": true,
// "wrapAttributes": true,
// "sortAttributes": false
// },
// "prettier": {
// "semi": false,
// "singleQuote": true,
// "trailingComma": "none",
// "wrapAttributes": true
// }
}
}