diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index f75782722d7..97b97f64fc6 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -343,16 +343,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 === '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 {