Is it possible to ignore files in jshint when running gulp --production?

I added modernizr back in via manifest.json, and its causing problems when I run gulp or gulp --production

line 4 col 2955 Too many errors. (80% scanned).

:heavy_multiplication_x: 1 error
:warning: 50 warnings

[12:35:54] ‘jshint’ errored after 117 ms
[12:35:54] Error in plugin ‘gulp-jshint’
JSHint failed for: assets/scripts/vendor/modernizr-2.8.3.min.js
[12:35:54] ‘build’ errored after 1.74 s
[12:35:54] Error in plugin ‘run-sequence’
An error occured in task ‘jshint’.

removing modernizr from manifest.json allows --production to run fine, so it there any way to ignore modernizr in this task?


You can ignore the file by adding

/* jshint ignore:start */

at the beginning of the file.

I just did this myself by manually adding an excluded file in gulpfile.js here:


gulp.task('jshint', function() {
  return gulp.src([
    'bower.json', 'gulpfile.js'

! means exclude.


How would this be applied to sage 9 with webpack?

Just ran into the same issue…

Place /* eslint-disable */ at the start of the little troublemaker and feel safe ignoring all the errors :innocent:


This isn’t working for me, anything else I can try?