当前位置:网站首页>vscode配置eslint自动格式化报错“The setting is deprecated. Use editor.codeActionsOnSave instead with a source“

vscode配置eslint自动格式化报错“The setting is deprecated. Use editor.codeActionsOnSave instead with a source“

2022-06-11 17:08:00 Boale_H

vscode配置eslint自动格式化报错"The setting is deprecated. Use editor.codeActionsOnSave instead with a source.fixAll.eslint member."

背景

在我们配置vscode自动依据eslint格式化代码的时候,报错The setting is deprecated. Use editor.codeActionsOnSave instead with a source.fixAll.eslint member.,意思是:该设置已弃用。 将 editor.codeActionsOnSave 与 source.fixAll.eslint 成员一起使用。
在这里插入图片描述

解决办法

解决方案如提示所示,删除"eslint.autoFixOnSave": true, ,用editor.codeActionsOnSave替代即可

{
    
  "search.followSymlinks": false,
  "editor.tabSize": 2,
  //配置eslint
  "eslint.validate": [
    "javascript",  // 用eslint的规则检测js文件
    "javascriptreact",
    "vue",
    "html",
  ],
  // 启用保存时自动修复eslint,默认只支持.js文件
  "editor.codeActionsOnSave": {
    
    "source.fixAll.eslint": true
  }
}
原网站

版权声明
本文为[Boale_H]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Boale_H/article/details/125209899