1. 全局安装 eslint

npm install -g eslint

2. control + shift + p 输入 settings 打开设置进行配置

在这里插入图片描述

3. 添加配置

{
    "workbench.colorTheme": "One Dark Pro",
    "eslint.debug": true,
    "eslint.execArgv": null,
    "eslint.alwaysShowStatus": true,
    "editor.codeActionsOnSave": {
        "source.fixAll": true,
        "source.fixAll.eslint": true
    },
    "eslint.validate": [
        "javascript",
        "vue",
        "html",
        "typescript",
    ],
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "eslint.format.enable": true,
    "eslint.runtime": "",
}```

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐