From 6533a6db4ae57ff48d3886a52ba5f486f1761f3f Mon Sep 17 00:00:00 2001 From: Laurin Quast Date: Fri, 27 Sep 2019 10:26:22 +0200 Subject: [PATCH] Update logic and log errors for EXTEND_ESLINT (#7530) --- .../react-scripts/config/webpack.config.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index f60a1ed06fa..ab2309b37d8 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -347,16 +347,16 @@ module.exports = function(webpackEnv) { // @remove-on-eject-begin ignore: process.env.EXTEND_ESLINT === 'true', baseConfig: (() => { - const eslintCli = new eslint.CLIEngine(); - let eslintConfig; - try { - eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs); - } catch (e) { - // A config couldn't be found. - } - // We allow overriding the config only if the env variable is set - if (process.env.EXTEND_ESLINT === 'true' && eslintConfig) { + if (process.env.EXTEND_ESLINT === 'true') { + const eslintCli = new eslint.CLIEngine(); + let eslintConfig; + try { + eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs); + } catch (e) { + console.error(e); + process.exit(1); + } return eslintConfig; } else { return {