【VsCode】强校验解决方法:修改配置文件

一般来说,按照如下三个步骤来,就可以了
也就是按照步骤修改配置文件而已

原本的

{
    "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"
}

1.打开编辑器,按住ctrl+,(按住Ctrl键 然后点击逗号!逗号!)

或者直接文件->首选项->设置

【VsCode】强校验解决方法:修改配置文件_第1张图片

2.点击图标进入配置文件settins.json页面

【VsCode】强校验解决方法:修改配置文件_第2张图片

3.在settins.json里面加上以下的代码

"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact"],
"eslint.run": "onSave",

【VsCode】强校验解决方法:修改配置文件_第3张图片

最后:如果没有成功,可以检查一下是否安装了Vetur插件和还有eslint插件

【VsCode】强校验解决方法:修改配置文件_第4张图片
【VsCode】强校验解决方法:修改配置文件_第5张图片

你可能感兴趣的:(【VsCode】强校验解决方法:修改配置文件)