它是 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",
当我npm run lint
在一个Linux 3.13.0-107-generic
/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 上重现此错误。
我该如何解决它的问题?