Skip to content

Commit

Permalink
chore(eslint): Have warnings fail the build
Browse files Browse the repository at this point in the history
Co-Authored-By: ExE-Boss <[email protected]>
  • Loading branch information
RunDevelopment and ExE-Boss committed Mar 30, 2019
1 parent 5d33bd6 commit 953fb50
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
});

parser = Prism.languages.insertBefore('inside', 'punctuation', {
Prism.languages.insertBefore('inside', 'punctuation', {
'expression': parser.expression,
'keyword': parser.keyword,
'variable': parser.variable,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-parser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,19 @@ function lint(cb) {
src(['**/*.js', '!node_modules/**'], { base: './' }),
eslint(),
eslint.format(),
eslint.failAfterError(),
eslint.results(({ errorCount, warningCount }) => {
if (errorCount > 0 || warningCount > 0) {
let err = new Error(
`Failed with ${errorCount} ${
errorCount === 1 ? 'error' : 'errors'
} and ${warningCount} ${
errorCount === 1 ? 'warning' : 'warnings'
}.`
);
err['showStack'] = false;
throw err;
}
}),
], cb);
}

Expand Down

0 comments on commit 953fb50

Please sign in to comment.