--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
28
node_modules/gulp-notify/examples/jshint.js
generated
vendored
Normal file
28
node_modules/gulp-notify/examples/jshint.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
var jshint = require('gulp-jshint');
|
||||
var notify = require('gulp-notify');
|
||||
var gulp = require('gulp');
|
||||
|
||||
gulp.task('lint', function() {
|
||||
gulp.src('/src/**/*.js')
|
||||
.pipe(jshint())
|
||||
// Use gulp-notify as jshint reporter
|
||||
.pipe(notify(function (file) {
|
||||
if (file.jshint.success) {
|
||||
// Don't show something if success
|
||||
return false;
|
||||
}
|
||||
|
||||
var errors = file.jshint.results.map(function (data) {
|
||||
if (data.error) {
|
||||
return "(" + data.error.line + ':' + data.error.character + ') ' + data.error.reason;
|
||||
}
|
||||
}).join("\n");
|
||||
return file.relative + " (" + file.jshint.results.length + " errors)\n" + errors;
|
||||
}));
|
||||
});
|
||||
|
||||
gulp.task('watch', ['lint'], function() {
|
||||
gulp.watch('/src/**/*.js', ['lint']);
|
||||
});
|
||||
|
||||
gulp.task('default', ['lint']);
|
||||
Loading…
Reference in a new issue