Skip to content

Commit

Permalink
Close GH-116: jshint only on build. Fixes #114
Browse files Browse the repository at this point in the history
  • Loading branch information
callumlocke authored and sindresorhus committed May 10, 2014
1 parent 73e9dde commit 864cdb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ gulp.task('styles', function () {<% if (includeSass) { %>
.pipe($.size());
});

gulp.task('scripts', function () {
gulp.task('jshint', function () {
return gulp.src('app/scripts/**/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter(require('jshint-stylish')))
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.jshint.reporter('fail'))
.pipe($.size());
});

gulp.task('html', ['styles', 'scripts'], function () {
gulp.task('html', ['styles'], function () {
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');

Expand Down Expand Up @@ -75,7 +76,7 @@ gulp.task('clean', function () {
return gulp.src(['.tmp', 'dist'], { read: false }).pipe($.clean());
});

gulp.task('build', ['html', 'images', 'fonts', 'extras']);
gulp.task('build', ['jshint', 'html', 'images', 'fonts', 'extras']);

gulp.task('default', ['clean'], function () {
gulp.start('build');
Expand Down Expand Up @@ -133,7 +134,6 @@ gulp.task('watch', ['connect', 'serve'], function () {
});

gulp.watch('app/styles/**/*.<%= includeSass ? 'scss' : 'css' %>', ['styles']);
gulp.watch('app/scripts/**/*.js', ['scripts']);
gulp.watch('app/images/**/*', ['images']);
gulp.watch('bower.json', ['wiredep']);
});
4 changes: 2 additions & 2 deletions test/gulp_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('Gulp Webapp generator: tasks', function () {
assertTaskExists(this.webapp, "styles", ['includeSass'], done);
});

it('should contain scripts task', function (done) {
assertTaskExists(this.webapp, "scripts", [], done);
it('should contain jshint task', function (done) {
assertTaskExists(this.webapp, "jshint", [], done);
});

it('should contain html task', function (done) {
Expand Down

0 comments on commit 864cdb8

Please sign in to comment.