Cant make gulp-notify to pop up a error message when gulp-jshint fail

梦想与她 提交于 2019-12-04 12:08:57

The error event in gulp only fires when an error in the stream occurs.

To add an error reporter to gulp-jshint pass it through the fail reporter:

 gulp.task('js-hint', function() {
      return gulp.src(config.source)
        .pipe(plumber())
        .pipe(jshint( config.jsHintRules))
        .pipe(jshint.reporter('jshint-stylish'))
        .pipe(jshint.reporter('fail'))
        .on('error', notify.onError({ message: 'JS hint fail'}));
  });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!