Skip to content

Commit 443af83

Browse files
committed
fix(gulp:jshint): split jshint into client and server tasks
make original jshint task run both tasks for server & client
1 parent 9fd160d commit 443af83

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

app/templates/gulpfile.babel.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,16 @@ function whenServerReady(cb) {
9393
// Reusable pipelines //
9494
////////////////////////
9595

96-
var lintScripts = lazypipe()<% if(filters.coffee) { %>
96+
var lintClientScripts = lazypipe()<% if(filters.coffee) { %>
9797
.pipe(plugins.coffeelint)
9898
.pipe(plugins.coffeelint.reporter);<% } else { %>
99-
.pipe(plugins.jshint, '.jshintrc')
99+
.pipe(plugins.jshint, 'client/.jshintrc')
100+
.pipe(plugins.jshint.reporter, 'jshint-stylish');<% } %>
101+
102+
var lintServerScripts = lazypipe()<% if(filters.coffee) { %>
103+
.pipe(plugins.coffeelint)
104+
.pipe(plugins.coffeelint.reporter);<% } else { %>
105+
.pipe(plugins.jshint, 'server/.jshintrc')
100106
.pipe(plugins.jshint.reporter, 'jshint-stylish');<% } %>
101107

102108
let styles = lazypipe()
@@ -150,7 +156,11 @@ gulp.task('coffee', () =>
150156
.pipe(gulp.dest('.tmp/scripts'));
151157
);<% } %>
152158

153-
gulp.task('lint:scripts', () => gulp.src(_.union(paths.client.scripts, paths.server.scripts)).pipe(lintScripts()));
159+
gulp.task('lint:scripts', cb => runSequence(['lint:scripts:client', 'lint:scripts:server'], cb));
160+
161+
gulp.task('lint:scripts:client', () => gulp.src(paths.client.scripts).pipe(lintClientScripts()));
162+
163+
gulp.task('lint:scripts:server', () => gulp.src(paths.server.scripts).pipe(lintServerScripts()));
154164

155165
gulp.task('clean:tmp', () => gulp.src('.tmp', {read: false}).pipe(plugins.clean()));
156166

0 commit comments

Comments
 (0)