当前位置:网站首页>Vscode configures eslint to automatically format with an error "the setting is deprecated. use editor.codeactionsonsave instead with a source“

Vscode configures eslint to automatically format with an error "the setting is deprecated. use editor.codeactionsonsave instead with a source“

2022-06-11 17:20:00 Boale_ H

vscode To configure eslint Auto format error "The setting is deprecated. Use editor.codeActionsOnSave instead with a source.fixAll.eslint member."

background

In our configuration vscode Automatic basis eslint When formatting code , Report errors The setting is deprecated. Use editor.codeActionsOnSave instead with a source.fixAll.eslint member., intend : This setting is deprecated . take editor.codeActionsOnSave And source.fixAll.eslint Use with members .
 Insert picture description here

terms of settlement

The solution is shown in the prompt , Delete "eslint.autoFixOnSave": true, , use editor.codeActionsOnSave Instead of

{
    
  "search.followSymlinks": false,
  "editor.tabSize": 2,
  // To configure eslint
  "eslint.validate": [
    "javascript",  //  use eslint Rule detection for js file 
    "javascriptreact",
    "vue",
    "html",
  ],
  //  Enable auto repair on save eslint, Only supported by default .js file 
  "editor.codeActionsOnSave": {
    
    "source.fixAll.eslint": true
  }
}
原网站

版权声明
本文为[Boale_ H]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111707405446.html