From f1f98461b8e98d6bdbe85c7fdda4027165e6d5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mime=20=C4=8Cuvalo?= Date: Thu, 22 Apr 2021 22:45:38 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20note=20in=20Changelog=20that=20v3?= =?UTF-8?q?=E2=86=92v4=20requires=20adding=20eslintConfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I came across this when trying to upgrade my company's create-react-app from v3→v4. The migration path doesn't note that you will lose ESLint capabilities unless you specify `eslintConfig` explicitly in your `package.json` going forward. Progression of ESLint changes in Webpack: - removal of original extend and addition to `template.json`: https://github.com/facebook/create-react-app/pull/9587/files - referencing of /base instead of /index: https://github.com/facebook/create-react-app/pull/9640/files#diff-8e25c4f6f592c1fcfc38f0d43d62cbd68399f44f494c1b60f0cf9ccd7344d697R366 This was also noticed by other developers in these bugs: https://github.com/facebook/create-react-app/issues/9791 https://github.com/facebook/create-react-app/issues/10212 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d32f878ccc..a7a1847117f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -223,6 +223,13 @@ Like any major release, `react-scripts@4.0.0` contains a number of breaking chan We've upgraded to ESLint 7 and added many new rules including some for Jest and React Testing Library as well as the `import/no-anonymous-default-export` rule. We've also upgraded `eslint-plugin-hooks` to version 4.0.0 and removed the `EXTEND_ESLINT` flag as it is no longer required to customize the ESLint config. +In particular, you'll need to add the following to `package.json` for ESLint to continue to work: +```js +"eslintConfig": { + "extends": ["react-app", "react-app/jest"] +}, +``` + ### Jest We've upgraded to Jest 26 and now set `resetMocks` to `true` by default in the Jest config.