I want to do a jshint on the files that is not library files like require js
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var ignore = require('gulp-ignore');
gulp.task('jshint', function() {
gulp.src('./js/src/*.js')
.pipe(ignore.exclude('require.js'))
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
This still reports require js
C:\Work\neolivz\js\src\require.js: line 12, col 267, Too many errors. (32% scanned).
Any idea?
I want to do a jshint on the files that is not library files like require js
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var ignore = require('gulp-ignore');
gulp.task('jshint', function() {
gulp.src('./js/src/*.js')
.pipe(ignore.exclude('require.js'))
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
This still reports require js
C:\Work\neolivz\js\src\require.js: line 12, col 267, Too many errors. (32% scanned).
Any idea?
Share Improve this question edited Aug 4, 2014 at 10:23 Neo asked Aug 4, 2014 at 9:31 NeoNeo 4,7606 gold badges38 silver badges55 bronze badges 4-
I think you should refer to it
ignore.exlude('./path/to/require.js');
if you're using gulp-ignore? – Samuli Hakoniemi Commented Aug 4, 2014 at 9:37 -
3
Or just
gulp.src(['./js/src/*.js', '!**/require.js'])
. – Chris Commented Aug 4, 2014 at 9:54 - Sorry, I was using gulp igore. I tried that also. But did not ignore. – Neo Commented Aug 4, 2014 at 10:22
- I am able to do .src filter, which is I am doing. but I would like to now how to do it with gulp-ignore and what I am doing wrong. – Neo Commented Aug 4, 2014 at 10:24
2 Answers
Reset to default 9You could also create a .jshintignore
file that, just like .gitignore
, contains files that you want to ignore.
I think you should be able to pass a regex to gulp ignore if using a specific path isn't working:
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var ignore = require('gulp-ignore');
gulp.task('jshint', function() {
gulp.src('./js/src/*.js')
.pipe(ignore.exclude(/require\.js/))
.pipe(jshint())
.pipe(jshint.reporter('default'));
});