Skip to content

Commit

Permalink
Update logic and log errors for EXTEND_ESLINT (#7530)
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l authored and mrmckeb committed Sep 27, 2019
1 parent 42ee721 commit 6533a6d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/react-scripts/config/webpack.config.js
Expand Up @@ -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 {
Expand Down

0 comments on commit 6533a6d

Please sign in to comment.