美文网首页
vscode 中eslint 自动检查保存并修复设置

vscode 中eslint 自动检查保存并修复设置

作者: 幸宇 | 来源:发表于2021-07-16 10:04 被阅读0次

在vs中找到setting.json设置文件,

{
    "workbench.iconTheme": "material-icon-theme",
    "explorer.confirmDragAndDrop": false,
    "explorer.confirmDelete": false,
    //配置eslint
    "eslint.autoFixOnSave": true, //  启用保存时自动修复,默认只支持.js文件
    "eslint.validate": [
        "javascript", //  用eslint的规则检测js文件
        {
            "language": "vue", // 检测vue文件
            "autoFix": true //  为vue文件开启保存自动修复的功能
        },
        {
            "language": "html",
            "autoFix": true
        },
    ],
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "terminal.integrated.tabs.enabled": true,
    "terminal.integrated.defaultProfile.windows": "PowerShell",
    "terminal.integrated.allowChords": false,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter.notebook.ipynb"
    },
    "security.workspace.trust.untrustedFiles": "newWindow",
    "diffEditor.ignoreTrimWhitespace": false,
    "editor.fontLigatures": null,
}

相关文章

网友评论

      本文标题:vscode 中eslint 自动检查保存并修复设置

      本文链接:https://www.haomeiwen.com/subject/yhwvpltx.html