gpt4 book ai didi

eslint - 规则 "react/jsx-indent"的配置无效 : Value "4,[object Object]" should NOT have more than 1 items

转载 作者:行者123 更新时间:2023-12-02 20:36:13 42 4
gpt4 key购买 nike

我今天上类时发现我的 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 时,我没有遇到任何问题,这使得这更加令人困惑!

任何帮助将不胜感激:)

最佳答案

为了防止将来有人遇到这个问题,我发现了这个问题。

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

应该是

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

我认为有人试图尝试解构:P

关于eslint - 规则 "react/jsx-indent"的配置无效 : Value "4,[object Object]" should NOT have more than 1 items,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49533844/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com