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

gulp.task('lint', () =>
  gulp.src('index.js')
  .pipe(eslint())
  .pipe(eslint.format())
);

gulp.task('build', () => (
  gulp.src('lib/index.js')
  .pipe(babel())
  .pipe(gulp.dest('dist'))
));

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

gulp.task('lint', () =>
  gulp.src('index.js')
  .pipe(eslint())
  .pipe(eslint.format())
);

gulp.task('build', ['lint'], () => (
  gulp.src('lib/index.js')
  .pipe(babel())
  .pipe(gulp.dest('dist'))
));

Add linting before build task in gulp
Add linting before build task in gulp
