command + p 搜索到settings.json文件,文件配置及註釋以下javascript
"workbench.iconTheme": "vscode-icons-mac",
"editor.renderIndentGuides": false,
"cSpell.ignoreWords": ["antd"],
//編輯器失去焦點時自動保存更新後的文件
"files.autoSave": "onFocusChange",
"workbench.colorTheme": "Monokai",
"git.confirmSync": false,
"window.title": "${activeEditorLong}${separator}${rootName}",
"window.zoomLevel": 0,
"editor.fontSize": 14,
//爲了符合eslint的兩個空格間隔原則
"editor.tabSize": 2,
// 文件頭部註釋
"fileheader.Author": "niuchunling",
"fileheader.LastModifiedBy": "niuchunling",
//關閉編輯器默認代碼檢查,爲了避免跟eslint配置衝突
"editor.formatOnSave": false,
"javascript.format.enable": false,
//eslint 格式化插件,保存時應用eslint規則自動格式化後保存
"eslint.autoFixOnSave": true,
"prettier.eslintIntegration": true,
// 去掉代碼結尾分號
"prettier.semi": false,
"git.path": "/usr/bin/git",
"editor.fontFamily": "Microsoft YaHei,Menlo, Monaco, 'Courier New', monospace",
"editor.fontWeight": "bold",
"javascript.updateImportsOnFileMove.enabled": "never",
"explorer.confirmDragAndDrop": false
}
複製代碼
在項目根目錄新建.vscode文件夾,文件夾中新建settings.json覆蓋全局的setings.json文件,配置同上java