diff --git a/gulpfile.js b/gulpfile.js index 0eb12ca5..c04ada25 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,6 +21,7 @@ const jscs = require('gulp-jscs'); const jshint = require('gulp-jshint'); const jshintStylish = require('jshint-stylish'); const sass = require('gulp-sass'); +const sequence = require('gulp-sequence'); const paths = { scripts: [ @@ -40,14 +41,22 @@ gulp.task('sass', function() { .pipe(gulp.dest('./build/css')); }); -gulp.task('lint', function() { +gulp.task('lint:jshint', function() { return gulp.src(paths.scripts) .pipe(jshint()) .pipe(jshint.reporter(jshintStylish)) - .pipe(jscs()) - .pipe(jscs.reporter()); + .pipe(jshint.reporter('fail')); }); +gulp.task('lint:jscs', function() { + return gulp.src(paths.scripts) + .pipe(jscs()) + .pipe(jscs.reporter()) + .pipe(jscs.reporter('fail')); +}); + +gulp.task('lint', sequence('lint:jshint', 'lint:jscs')); + gulp.task('watch', [ 'lint', 'sass' ], function() { gulp.watch(paths.scripts, [ 'lint' ]); gulp.watch(paths.sass, [ 'sass' ]); diff --git a/package.json b/package.json index 14e9a46a..5bf28e40 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "gulp-jscs": "^3.0.2", "gulp-jshint": "^2.0.0", "gulp-sass": "^2.0.4", + "gulp-sequence": "^0.4.5", "jshint": "^2.9.1", "jshint-stylish": "^2.0.1", "jsonfile": "^2.3.1",