vscode中配置Eslint自动修复并保存代码

在文件>>>>首选项设置>>>>>设置中搜索eslint
在这里插入图片描述
**在settings.json中进行修改,最外面的大括号加入以下代码即可。

   "editor.codeActionsOnSave": {
    
    
        "source.fixAll.eslint": true,
        "eslint.autoFixOnSave" : true,
    },

文件保存之后,就可以自动修复代码。

猜你喜欢

转载自blog.csdn.net/qq_38132995/article/details/114021389