chore(gulp): make linter exit with a non-zero code (#510)

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-06-22 16:36:14 -04:00 committed by GitHub
parent c4c8e2c038
commit 2f3118e4c3
2 changed files with 13 additions and 3 deletions

View File

@ -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' ]);

View File

@ -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",