Skip to content

Commit

Permalink
Fix infinite loop when linting tests (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernie-hs authored Mar 1, 2020
1 parent 4fa8e67 commit a4d367e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,19 @@ async function modernizr() {
}
<%_ } -%>

const lintBase = files => {
const lintBase = (files, options) => {
return src(files)
.pipe($.eslint({ fix: true }))
.pipe($.eslint(options))
.pipe(server.reload({stream: true, once: true}))
.pipe($.eslint.format())
.pipe($.if(!server.active, $.eslint.failAfterError()));
}
function lint() {
return lintBase('app/scripts/**/*.js')
return lintBase('app/scripts/**/*.js', { fix: true })
.pipe(dest('app/scripts'));
};
function lintTest() {
return lintBase('test/spec/**/*.js')
.pipe(dest('test/spec'));
return lintBase('test/spec/**/*.js');
};

function html() {
Expand Down Expand Up @@ -212,8 +211,8 @@ function startTestServer() {
}
});

watch('test/index.html').on('change', server.reload);
watch('app/scripts/**/*.js', scripts);
watch(['test/spec/**/*.js', 'test/index.html']).on('change', server.reload);
watch('test/spec/**/*.js', lintTest);
}

Expand Down

0 comments on commit a4d367e

Please sign in to comment.