adametry / gulp-eslint

A Gulp plugin for identifying and reporting on patterns found in ECMAScript/JavaScript code.
MIT License
563 stars 118 forks source link

Add support for eslint@5.0.0 #228

Closed gucong3000 closed 6 years ago

gucong3000 commented 6 years ago

When I update eslint to 5.0.0 I got a error: Parsing error: Cannot read property 'ecmaFeatures' of undefined

'use strict';

const eslint = require('gulp-eslint');
const vfs = require('vinyl-fs');

vfs.src('test/fixtures/eslint/invalid.js', {
    base: process.cwd(),
})
    .pipe(eslint())
    .on('data', file => {
        file.eslint.messages.forEach(error=>{
            console.error(error);
        })
    });

test/fixtures/eslint/invalid.js

a = 1;

.eslintrc.json

{
    "extends": [
        "standard"
    ],
    "root": true
}
$ eslint test/fixtures/eslint/invalid.js

E:\work\gulp-reporter\test\fixtures\eslint\invalid.js
  1:1  error  'a' is not defined  no-undef
  1:6  error  Extra semicolon     semi

✖ 2 problems (2 errors, 0 warnings)
  1 error, 0 warnings potentially fixable with the `--fix` option.

(node:9236) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard")
ba55ie commented 6 years ago

It also fails on the new options for existing rules, like the array-element-newline rule, which now has a consistent option.

https://eslint.org/blog/2018/06/eslint-v5.0.0-released https://eslint.org/docs/user-guide/migrating-to-5.0.0