gpt4 book ai didi

linux - 得到 'Configuration for rule "no-unused-expressions"is invalid' on linux but not on osx

转载 作者:太空狗 更新时间:2023-10-29 11:25:02 25 4
gpt4 key购买 nike

是package.json中的依赖

"babel-eslint": "7.1.1",
"eslint": "3.17.1",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.0",

当我在 Linux 3.13.0-107-generic 上运行 npm run lint

/home/ubuntu/webview/analytics2/node_modules/eslint-config-airbnb-base/rules/best-practices.js:
Configuration for rule "no-unused-expressions" is invalid:
Value "data["0"].allowTaggedTemplates" has additional properties.

Referenced from: /home/ubuntu/webview/analytics2/node_modules/eslint-config-airbnb-base/index.js
Referenced from: airbnb
Referenced from: /home/ubuntu/webview/analytics2/.eslintrc
Error: /home/ubuntu/webview/analytics2/node_modules/eslint-config-airbnb-base/rules/best-practices.js:
Configuration for rule "no-unused-expressions" is invalid:
Value "data["0"].allowTaggedTemplates" has additional properties.

Referenced from: /home/ubuntu/webview/analytics2/node_modules/eslint-config-airbnb-base/index.js
Referenced from: airbnb
Referenced from: /home/ubuntu/webview/analytics2/.eslintrc
at validateRuleOptions (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-validator.js:109:15)
at Object.keys.forEach.id (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-validator.js:156:13)
at Array.forEach (native)
at Object.validate (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-validator.js:155:35)
at load (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-file.js:529:19)
at configExtends.reduceRight.e (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-file.js:391:36)
at Array.reduceRight (native)
at applyExtends (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-file.js:362:28)
at load (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-file.js:536:22)
at configExtends.reduceRight.e (/home/ubuntu/webview/analytics2/node_modules/eslint/lib/config/config-file.js:391:36)

我想错误是由于 Configuration for rule "no-unused-expressions"is invalid: 如上面的堆栈跟踪所示。

就是.eslintrc的内容:

{
"extends": "airbnb",
"env": {
"browser": true,
"mocha": true,
"node": true
},
"globals": {
"expect": true,
"URLSearchParams": true
},
"parser": "babel-eslint",
"rules": {
"max-len": [2, 80, 4, {"ignoreComments": true}],
"valid-jsdoc": 2,
"react/jsx-filename-extension": "off",
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": 0,
"import/extensions": 0
},
"plugins": [
"react"
]
}

但是我无法在我的 OSX MBP 上重现此错误。

我该如何解决这个问题?

最佳答案

我今天刚遇到同样的问题。我的建议是运行 npm outdated 并升级 eslint 相关包。

对我来说,解决问题的方法是将 eslint 升级到 3.18.0 并将 eslint-plugin-react 升级到 6.10.3。

关于linux - 得到 'Configuration for rule "no-unused-expressions"is invalid' on linux but not on osx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43039265/

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