From 61cfcecc1719109dfd30d35e62379809ca069cdb Mon Sep 17 00:00:00 2001 From: milocosmopolitan Date: Mon, 1 May 2017 10:18:36 -0400 Subject: [PATCH] when build is failing due to ESLint errors, filter warnings out --- packages/react-scripts/scripts/build.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react-scripts/scripts/build.js b/packages/react-scripts/scripts/build.js index fe4ec959d4d..dd20e5ea760 100644 --- a/packages/react-scripts/scripts/build.js +++ b/packages/react-scripts/scripts/build.js @@ -90,14 +90,14 @@ function build(previousFileSizes) { if (stats.compilation.errors.length) { printErrors('Failed to compile.', stats.compilation.errors); process.exit(1); - } - - if (process.env.CI && stats.compilation.warnings.length) { - printErrors( - 'Failed to compile. When process.env.CI = true, warnings are treated as failures. Most CI servers set this automatically.', - stats.compilation.warnings - ); - process.exit(1); + } else { + if (stats.compilation.warnings.length) { + printErrors( + 'Failed to compile. When process.env.CI = true, warnings are treated as failures. Most CI servers set this automatically.', + stats.compilation.warnings + ); + if (process.env.CI) process.exit(1); + } } console.log(chalk.green('Compiled successfully.'));