[Javascript] Using JSHint for Linting with Gulp

gulpfile.js

var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var path = {
    js: 'js/**/ *.js'
}

gulp.task('jshint', function () {
    gulp.src('js/app.js')
        .pipe(jshint())
        .pipe(jshint.reporter(stylish));
});

 

.jshintrc

{
  "undef": true,
  "unused": true,
  "globals": {
    "angular": false  // for angular we don't want to get error of it is undefined
  }
}

 

posted @ 2015-10-12 01:36  Zhentiw  阅读(237)  评论(0编辑  收藏  举报