1、打开setting.json,在里面编辑
2、上代码
{
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "readme",
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.limit.enabled": true,
"workbench.editor.limit.perEditorGroup": true,
"workbench.editor.limit.value": 5,
"extensions.autoUpdate": "onlyEnabledExtensions",
"extensions.ignoreRecommendations": true,
"window.nativeTabs": true, // this is great, macOS
"explorer.confirmDelete": false,
"explorer.compactFolders": false,
// "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.fontWeight": "300",
"editor.fontSize": 18,
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.linkedEditing": true,
// "editor.formatOnPaste": true,
"editor.guides.bracketPairs": "active",
"editor.cursorSmoothCaretAnimation": "on",
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true // this allows ESLint to auto fix on save
},
"search.exclude": {
"**/dist": true
},
"files.eol": "\n", // Uses macOS specific end of line character
"files.exclude": {
// "**/node_modules": true,
"**/dist": true
},
}
我是这么配置的,按ctrl+s保存自动格式化