Permalink
Browse files

use gulp-eslint

  • Loading branch information...
1 parent 2153784 commit 2389539278d7a3ed7d017524ac2fea0975212062 @jonschlinkert jonschlinkert committed May 13, 2016
Showing with 20 additions and 17 deletions.
  1. +20 −17 gulpfile.js
View
@@ -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.