我正在开发一个具有 eslintrc 文件的项目,当我在 Intellij 项目中运行 npm run test 时。我收到一个错误
Expected indentation of 1 tab character but found 0
我尝试选中启用 ESlint 搜索 .eslintrc 文件的框 > 其他设置 > 默认设置 > 语言和框架 > javascript > 代码质量工具 > ESLint
{
"parser": "babel-eslint",
"extends": [
"airbnb",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": [
"react",
"flow-vars"
],
"settings": {
"import/ignore": [
"node_modules",
"\\.(html|json|properties)$",
"DevTools"
],
"import/resolver": {
"webpack": {
"config": "./src/js/webpack/webpack.base.config.js"
}
}
},
"rules": {
"eqeqeq": [2, "allow-null"],
"flow-vars/define-flow-type": 1,
"flow-vars/use-flow-type": 1,
"func-names": 0,
"import/no-named-as-default": 0,
"indent": [2, "tab", {"SwitchCase": 1}],
"new-cap": 0,
"no-multi-spaces": [2, {"exceptions": {"VariableDeclarator": true}}],
"no-param-reassign": [2, {"props": false}],
"no-script-url": 0,
"no-unused-vars": [2, {"args": "after-used", "argsIgnorePattern": "^_"}],
"no-use-before-define": [2, "nofunc"],
"quote-props": [2, "consistent-as-needed"],
"react/jsx-indent-props": [2, "tab"],
"react/jsx-no-bind": [2, {
"ignoreRefs": false,
"allowArrowFunctions": false,
"allowBind": false
}],
"space-before-function-paren": 0,
"spaced-comment": 0
},
"globals": {
"__ENV__": false,
"__DEV__": false,
"__TEST__": false
}
}
我什至尝试在设置中将选项卡编号从 4 更改为 2,但出现错误。任何帮助表示赞赏。