在VSCode中配置Eslint 格式化時使代碼保持Eslint語法規範javascript
安裝Eslint以及prettier美化插件html
在VSCode配置設置項中添加以下代碼vue
{ "workbench.colorTheme": "Material Theme", "search.followSymlinks": false, "editor.fontSize": 18, "workbench.iconTheme": "material-icon-theme", "workbench.editor.enablePreview": false, "window.zoomLevel": 0, "extensions.autoUpdate": false, "prettier.singleQuote": true, "prettier.semi": false, "vetur.format.defaultFormatter.html": "js-beautify-html", //配置eslint "eslint.autoFixOnSave": true, "files.autoSave":"off", "eslint.validate": [ "javascript", "javascriptreact", "html", { "language": "vue", "autoFix": true } ], "eslint.options": { "plugins": ["html"] }, //爲了符合eslint的兩個空格間隔原則 "editor.tabSize": 2 }