From 99171321c38dd2c1893a7e348b51a725d04e63cb Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Wed, 30 Aug 2017 08:03:17 -0700 Subject: [PATCH] Lint command fails if there are any warnings (#10572) You get a lint failure! You get a lint failure! Eeeeverybody gets a lint failure! --- scripts/tasks/eslint.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/tasks/eslint.js b/scripts/tasks/eslint.js index 027b97cf62..5c4841f4d6 100644 --- a/scripts/tasks/eslint.js +++ b/scripts/tasks/eslint.js @@ -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); });