安装插件
- Prettier - Code formatter
- Vetur
- JS-CSS-HTML Formatter
- ESLint
setting.json
{
"workbench.startupEditor": "newUntitledFile",
"files.autoSave": "off",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"files.eol": "\n",
"editor.detectIndentation": false,
"editor.fontSize": 14,
"editor.lineHeight": 0,
"editor.lineNumbers": "on",
"prettier.singleQuote": true,
"prettier.printWidth": 220,
"prettier.jsxBracketSameLine": true,
"prettier.jsxSingleQuote": true,
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"window.zoomLevel": 0,
"files.associations": {
"*.vue": "vue"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"vue"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.run": "onSave",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"workbench.iconTheme": "vscode-icons",
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#ffd700",
"editorBracketPairGuide.activeBackground1": "#ffd7007f",
"editorBracketHighlight.foreground2": "#da70d6",
"editorBracketPairGuide.activeBackground2": "#da70d67f",
"editorBracketHighlight.foreground3": "#87cefa",
"editorBracketPairGuide.activeBackground3": "#87cefa7f",
"editorBracketHighlight.foreground4": "#ffd700",
"editorBracketPairGuide.activeBackground4": "#ffd7007f",
"editorBracketHighlight.foreground5": "#da70d6",
"editorBracketPairGuide.activeBackground5": "#da70d67f",
"editorBracketHighlight.foreground6": "#87cefa",
"editorBracketPairGuide.activeBackground6": "#87cefa7f",
"editorBracketHighlight.unexpectedBracket.foreground": "#ff0000",
},
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": "active",
"prettier.semi": false,
}