Visual studio code VSCode-editor.codeActionsOnSave-source.fixAll.eslint-true表示错误,false表示警告
我希望VS代码在保存时修复所有的林线错误,但忽略警告 此规则修复了保存时可以修复的所有内容:Visual studio code VSCode-editor.codeActionsOnSave-source.fixAll.eslint-true表示错误,false表示警告,visual-studio-code,eslint,vscode-settings,Visual Studio Code,Eslint,Vscode Settings,我希望VS代码在保存时修复所有的林线错误,但忽略警告 此规则修复了保存时可以修复的所有内容: "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, .eslintrc.js: rules: { 'react/self-closing-comp': process.env.NODE_ENV === 'prod
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
.eslintrc.js:
rules: {
'react/self-closing-comp':
process.env.NODE_ENV === 'production'
? 'error'
: 'warn',
但我希望它忽略警告
我该怎么做呢?你读过例如吗?还有:为什么要有条件过梁规则?您希望您的代码针对不同的环境重新格式化吗?谢谢,是的,我看过了,它是关于
autoFixOnSave
的,现在已经不推荐了。有条件linting规则,因为有时我希望在不同的环境中使用不同的规则。这与我希望错误自动格式化而警告不自动格式化这一事实无关。