[英]Gulp-eslint causing configuration errors
When trying to run my linter standalone from the command line eslint .
当尝试从命令行eslint .
独立运行我的eslint .
, everything works as expected. ,一切都会按预期进行。 The issue comes when I try to run an "eslint" task via gulp. 当我尝试通过gulp运行“ eslint”任务时,就会出现问题。
My .eslintrc
extends airbnb-base
which is where the error is being thrown: 我的.eslintrc
扩展了airbnb-base
,这是引发错误的地方:
Configuration for rule "prefer-destructuring" is invalid:
Value "data["0"].VariableDeclarator" has additional properties.
Value "data["0"].AssignmentExpression" has additional properties.
This is 1 of a couple of errors all of the same structure. 这是相同结构的几个错误之一。 The configuration rule is valid having looked at the docs : 查看文档后 ,配置规则有效:
// Prefer destructuring from arrays and objects
// http://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': ['error', {
VariableDeclarator: {
array: false,
object: true,
},
AssignmentExpression: {
array: true,
object: true,
},
}, {
enforceForRenamedProperties: false,
}],
Looking at the , the rule configuration seems to be accurate. 看一下,规则配置似乎很准确。
I am very unsure as to what this error is so any help will be appreciated, thank you! 我不确定这个错误是什么,因此将不胜感激,谢谢!
The issue was simply that my gulp-eslint
package was out-of-date. 问题仅仅是我gulp-eslint
软件包已过期。 I was running @ 3.0.1 whereas the latest stable release at this time was 4.0.2 我正在运行@ 3.0.1,而此时最新的稳定版本是4.0.2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.