From aa61ca70000a00a8a2a07f87d347994040da6fa9 Mon Sep 17 00:00:00 2001 From: Laurin Quast Date: Wed, 14 Aug 2019 08:21:24 +0200 Subject: [PATCH] only load eslint config when EXTEND_ESLINT environment variable is specified --- .../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 12157a390b8..e75cf14cbd2 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -339,16 +339,16 @@ module.exports = function(webpackEnv) { resolvePluginsRelativeTo: __dirname, // @remove-on-eject-begin 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 && eslintConfig) { + if (process.env.EXTEND_ESLINT) { + 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 {