Skip to content

Commit

Permalink
Lint command fails if there are any warnings (#10572)
Browse files Browse the repository at this point in the history
You get a lint failure! You get a lint failure! Eeeeverybody gets a lint failure!
  • Loading branch information
bvaughn authored Aug 30, 2017
1 parent cd52f7e commit 9917132
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/tasks/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ var spawn = require('child_process').spawn;

var extension = process.platform === 'win32' ? '.cmd' : '';

spawn(path.join('node_modules', '.bin', 'eslint' + extension), ['.'], {
// Allow colors to pass through
stdio: 'inherit',
}).on('close', function(code) {
spawn(
path.join('node_modules', '.bin', 'eslint' + extension),
['.', '--max-warnings=0'],
{
// Allow colors to pass through
stdio: 'inherit',
}
).on('close', function(code) {
if (code !== 0) {
console.error('Lint failed');
} else {
console.log('Lint passed');
}

console.log('Lint passed');
process.exit(code);
});

0 comments on commit 9917132

Please sign in to comment.