From c339748843629ffd2427ab4fdaa5632d40f7526e Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Mon, 12 Aug 2019 09:19:07 -0700 Subject: [PATCH 1/2] Remove extends restriction to fix ESLint 6 support --- .../react-scripts/config/webpack.config.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index dad50a319d4..5ba1a75f2e0 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -340,21 +340,12 @@ module.exports = function(webpackEnv) { // @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. - } + const eslintConfig = eslintCli.getConfigForFile( + paths.appIndexJs + ); - // We allow overriding the config, only if it extends our config - // (`extends` can be a string or array of strings). - if ( - process.env.EXTEND_ESLINT && - eslintConfig && - eslintConfig.extends && - eslintConfig.extends.includes('react-app') - ) { + // We allow overriding the config only if the env variable is set + if (process.env.EXTEND_ESLINT && eslintConfig) { return eslintConfig; } else { return { From 61d5dfa9c59cb320081b871236a7c48100059d1b Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Mon, 12 Aug 2019 13:19:37 -0700 Subject: [PATCH 2/2] Attempt to resolve CI errors --- docusaurus/docs/setting-up-your-editor.md | 2 +- packages/react-scripts/config/webpack.config.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docusaurus/docs/setting-up-your-editor.md b/docusaurus/docs/setting-up-your-editor.md index 844b9bc5da2..b2d0b51cca6 100644 --- a/docusaurus/docs/setting-up-your-editor.md +++ b/docusaurus/docs/setting-up-your-editor.md @@ -47,7 +47,7 @@ Note that any rules set to `"error"` will stop the project from building. There are a few things to remember: -1. You must extend the base config, as removing it could introduce hard-to-find issues. +1. We highly recommend extending the base config, as removing it could introduce hard-to-find issues. 1. When working with TypeScript, you'll need to provide an `overrides` object for rules that should _only_ target TypeScript files. In the below example: diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 5ba1a75f2e0..12157a390b8 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -340,9 +340,12 @@ module.exports = function(webpackEnv) { // @remove-on-eject-begin baseConfig: (() => { const eslintCli = new eslint.CLIEngine(); - const eslintConfig = eslintCli.getConfigForFile( - paths.appIndexJs - ); + 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) {