vscode eslint配置

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": "",
}```

你可能感兴趣的:(js,vscode)