1. 全局安装 eslint
npm install -g eslint文章来源:https://www.toymoban.com/news/detail-611657.html
2. control + shift + p 输入 settings 打开设置进行配置
文章来源地址https://www.toymoban.com/news/detail-611657.html
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": "",
}```
到了这里,关于vscode eslint配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!