当前位置:网站首页>Resolve the format conflict between formatted document and eslint

Resolve the format conflict between formatted document and eslint

2022-06-25 16:08:00 . calin.

Right click the back point format document Formable document , But the format of the formatted document is the same as eslint The required format is conflicting .
 Insert picture description here # solve
1. Change the format after formatting , Make it and eslint Consistent requirements
src Create configuration file in directory .prettierrc Modify the formatted format , Such as the following code in the file :
The first line means no semicolon after formatting
The second line indicates using single quotation marks

{
    
    "semi":false,
    "singleQuote":true
}

2. change eslint The rules of , No requirements for a certain format , Don't complain
Pictured , Some eslint The error of , There are wrong rules in the box
 Insert picture description here

find .eslintrc.js In the document rules, Pictured , Set the value to 0 To eliminate the rule
 Insert picture description here

原网站

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