Advertisement
Guest User

javascript linting using gulp-jshint

a guest
May 8th, 2015
743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env node
  2.  
  3. var jshint = require('gulp-jshint');
  4. var stylish = require('jshint-stylish');
  5. var gulp   = require('gulp');
  6.  
  7. var jshintConfig = {
  8.     "lookup": false,
  9.     "curly": true,
  10.     "devel": true,
  11.     "eqeqeq": true,
  12.     "globals":{
  13.         "angular": true,
  14.         "define": true
  15.     },
  16.     "indent":2,
  17.     "quotmark": "single",
  18.     "strict": true,
  19.     "trailing": true,
  20.     "undef": true,
  21.     "unused": true
  22. };
  23.  
  24. gulp.task('lint', function() {
  25.   return gulp.src('./www/assets/js/**/**/*.js')
  26.     .pipe(jshint(jshintConfig))
  27.     .pipe(jshint.reporter(stylish))
  28.     .pipe(jshint.reporter('fail'));
  29. });
  30.  
  31. gulp.start('lint');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement