const gulp = require('gulp');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
const changed = require('gulp-changed');
const eslint = require('gulp-eslint');

gulp.task('lint', function() {
  return gulp.src('src/**/*.js')
    .pipe(changed('lib'))
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failAfterError())
});

gulp.task('compile', () => {
  return gulp.src('src/**/*.js')
    .pipe(changed('lib'))
    .pipe(sourcemaps.init())
    .pipe(babel({
      presets: ['env']
    }))
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('lib'));
});

gulp.task('watch', () => {
  gulp.watch('src/**/*.js',['lint', 'compile']);
});

gulp.task('default', ['watch']);

@@ -652,16 +652,17 @@
 */*.js',
+ 
 %5B'lint',
@@ -709,12 +709,31 @@
 %5B'watch'
+, 'lint', 'compile'
 %5D);%0A

update gulfile