Skip to content

Commit 6533a6d

Browse files
n1ru4lmrmckeb
authored andcommitted
Update logic and log errors for EXTEND_ESLINT (#7530)
1 parent 42ee721 commit 6533a6d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/react-scripts/config/webpack.config.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,16 @@ module.exports = function(webpackEnv) {
347347
// @remove-on-eject-begin
348348
ignore: process.env.EXTEND_ESLINT === 'true',
349349
baseConfig: (() => {
350-
const eslintCli = new eslint.CLIEngine();
351-
let eslintConfig;
352-
try {
353-
eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs);
354-
} catch (e) {
355-
// A config couldn't be found.
356-
}
357-
358350
// We allow overriding the config only if the env variable is set
359-
if (process.env.EXTEND_ESLINT === 'true' && eslintConfig) {
351+
if (process.env.EXTEND_ESLINT === 'true') {
352+
const eslintCli = new eslint.CLIEngine();
353+
let eslintConfig;
354+
try {
355+
eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs);
356+
} catch (e) {
357+
console.error(e);
358+
process.exit(1);
359+
}
360360
return eslintConfig;
361361
} else {
362362
return {

0 commit comments

Comments
 (0)