Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code VSCode-editor.codeActionsOnSave-source.fixAll.eslint-true表示错误,false表示警告_Visual Studio Code_Eslint_Vscode Settings - Fatal编程技术网

Visual studio code VSCode-editor.codeActionsOnSave-source.fixAll.eslint-true表示错误,false表示警告

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

我希望VS代码在保存时修复所有的林线错误,但忽略警告

此规则修复了保存时可以修复的所有内容:

    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
.eslintrc.js:

    rules: {
        'react/self-closing-comp':
            process.env.NODE_ENV === 'production'
                ? 'error'
                : 'warn',
但我希望它忽略警告


我该怎么做呢?

你读过例如吗?还有:为什么要有条件过梁规则?您希望您的代码针对不同的环境重新格式化吗?谢谢,是的,我看过了,它是关于
autoFixOnSave
的,现在已经不推荐了。有条件linting规则,因为有时我希望在不同的环境中使用不同的规则。这与我希望错误自动格式化而警告不自动格式化这一事实无关。