4

我今天上班时发现我的 linter 包中出现了一个不寻常的错误。我查看了包的文档,但我的 eslintrc 文件看不到任何问题。

这是我正在使用的副本

{
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
    "import/no-extraneous-dependencies": "off",
    "import/extensions": "off",
    "import/no-unresolved": "off",
    "eol-last": "off",
    "no-unused-expressions": ["error",{
        "allowTernary": true,
        "allowShortCircuit": true
        }],
    "react/jsx-indent-props": "off",
    "react/jsx-indent" : ["error", 4, { "props": 4 }],
    "indent": [ "error", 4],
    "react/jsx-filename-extension": "off",
    "jsx-a11y/anchor-is-valid": [
        "error",
        {
            "components": [],
            "specialLink": [
                "hrefLeft",
                "hrefRight"
            ],
            "aspects": [
                "noHref",
                "invalidHref",
                "preferButton"
            ]
        }
    ],
    "no-bitwise": "off"
},
"env": {
    "browser": true,
    "jest": true
}

}

当我从命令行运行 eslint 时,我没有任何问题,这使得这更加令人困惑!

任何帮助将不胜感激 :)

4

1 回答 1

10

万一以后有人遇到这个问题,我发现了这个问题。

"react/jsx-indent" : ["error", 4, { "props": 4 }],

应该

"react/jsx-indent" : ["error", 4],

我认为有人试图对解构感兴趣:P

于 2018-03-28T15:28:37.410 回答