I'm trying to get gulp-eslint working. Here is my package.json:
"devDependencies": {
"eslint": "^5.4.0",
"eslint-plugin-babel": "^5.1.0",
"gulp": "^3.9.1",
"gulp-eslint": "^5.0.0",
}
There was no mention of dependencies on the gulp-eslint Github page but when I first ran my gulp lint
task, I was prompted to install eslint-plugin-babel
so I assume it is required.
Here is my task:
var gulp = require('gulp');
var eslint = require('gulp-eslint');
gulp.task('lint', function () {
gulp.src('js/scripts.js)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
Here is my .eslintrc.json
:
{
"parserOptions": {
"ecmaVersion": 6
},
"env": {
"es6": true
},
"rules": {}
}
When I run gulp lint
I get this error:
Error: ESLint configuration in .eslintrc is invalid:
- Unexpected top-level property "parseOptions"
The eslint docs use parserOptions
so I'm not sure where parseOptions
is coming from. What am I missing?
I got it working after installing a whole bunch of eslint dependencies.
It seems odd that you'd need this many packages to get eslint working, but this worked for me.