使用ESLint时如何获得警告而不是错误?
我将ESLint 6.7.2
版本与babel插件一起使用并做出反应。
这是我实际的.eslintrc.json
:
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
},
"settings": {
"react" : {
"version": "16.7.0"
}
},
"parser": "babel-eslint"
}
答案 0 :(得分:1)
我找到了答案:
足以为no-unused-vars
添加规则:
"rules": {
"no-unused-vars": "warn"
},