Search code examples
javascriptgulpeslinteslint-config-airbnb

Gulp-eslint causing configuration errors


When trying to run my linter standalone from the command line eslint ., everything works as expected. The issue comes when I try to run an "eslint" task via gulp.

My .eslintrc extends airbnb-base which is where the error is being thrown:

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.

  • eslint @ 4.16.0
  • eslint-config-airbnb-base @ 12.1.0
  • gulp-eslint @ 3.0.1
  • gulp @ 3.9.1

I am very unsure as to what this error is so any help will be appreciated, thank you!


Solution

  • The issue was simply that my gulp-eslint package was out-of-date. I was running @ 3.0.1 whereas the latest stable release at this time was 4.0.2