当前位置:网站首页>Vscode configures eslint to automatically format an error "auto fix is enabled by default. use the single string form“

Vscode configures eslint to automatically format an error "auto fix is enabled by default. use the single string form“

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

vscode To configure eslint Auto format error "Auto Fix is enabled by default. Use the single string form"

background

In our configuration vscode Automatic basis eslint When formatting code , Report errors Auto Fix is enabled by default. Use the single string form, intend : Auto repair is enabled by default . Use single string form
 Insert picture description here

terms of settlement

The solution is shown in the prompt , Delete "autoFix": true,, Configure the file type to be verified in the form of a single string

{
    
  "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/202206111707405365.html