Skip to content

Commit

Permalink
use gulp-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed May 13, 2016
1 parent 2153784 commit 2389539
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions gulpfile.js
@@ -1,33 +1,36 @@
'use strict';

var stylish = require('jshint-stylish');
var istanbul = require('gulp-istanbul');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var gulp = require('gulp');

var lint = ['index.js', 'lib/*.js'];

gulp.task('lint', function() {
return gulp.src(lint)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var eslint = require('gulp-eslint');
var unused = require('gulp-unused');

gulp.task('coverage', function() {
return gulp.src(lint)
.pipe(istanbul())
return gulp.src(['index.js', 'lib/**/*.js'])
.pipe(istanbul({includeUntested: true}))
.pipe(istanbul.hookRequire());
});

gulp.task('test', ['coverage'], function() {
gulp.task('mocha', ['coverage'], function() {
return gulp.src('test/*.js')
.pipe(mocha({reporter: 'spec'}))
.pipe(istanbul.writeReports())
.pipe(istanbul.writeReports({
reporters: [ 'text', 'text-summary' ],
reportOpts: {dir: 'coverage', file: 'summary.txt'}
}))
}));
});

gulp.task('eslint', function() {
return gulp.src(['*.js', 'lib/**/*.js', 'test/*.js'])
.pipe(eslint());
});

gulp.task('unused', function() {
var utils = require('./lib/utils');
return gulp.src(['index.js', 'lib/**/*.js'])
.pipe(unused({keys: Object.keys(utils)}));
});

gulp.task('default', ['lint', 'test']);
gulp.task('default', ['mocha', 'eslint']);

0 comments on commit 2389539

Please sign in to comment.