一般来说,按照如下三个步骤来,就可以了
也就是按照步骤修改配置文件而已
原本的
{
"workbench.startupEditor": "newUntitledFile",
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"editor.tabSize": 2,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"files.exclude": {
"**/.git": false,
"**/.hg": false,
"**/.svn": false,
"**/CVS": false
},
"files.watcherExclude": {
"**/bower_components/**": true,
"**/dist/**": true,
"**/tmp/**": true
},
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
},
{
"language": "html",
"autoFix": true
}
],
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"editor.tabCompletion": "on",
"javascript.updateImportsOnFileMove.enabled": "never",
"code-runner.runInTerminal": true,
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"window.zoomLevel": -1,
"git.enableSmartCommit": true,
"workbench.sideBar.location": "left",
"search.exclude": {
"**/.**/**": true,
"**/**.md": true,
"**/package-lock.json": true,
"**/package.json": true,
"**/public": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.fontSize": 14,
"explorer.confirmDelete": false,
"explorer.autoReveal": false,
"explorer.confirmDragAndDrop": false,
"explorer.compactFolders": false,
"typescript.updateImportsOnFileMove.enabled": "always"
}
ctrl+,
(按住Ctrl键 然后点击逗号!逗号!)文件->首选项->设置
settins.json
页面settins.json
里面加上以下的代码"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact"],
"eslint.run": "onSave",
Vetur插件
和还有eslint插件