Skip to content

Commit 08bcdaa

Browse files
committed
feat(eslint-config-react-app): support ESLint 8.x
BREAKING CHANGE: Requires ESLint@^8.0.0
1 parent 5cedfe4 commit 08bcdaa

File tree

7 files changed

+28607
-29168
lines changed

7 files changed

+28607
-29168
lines changed

Diff for: package-lock.json

+28,578-29,140
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@testing-library/react": "^11.1.0",
2626
"@testing-library/user-event": "^12.1.10",
2727
"alex": "^8.2.0",
28-
"eslint": "^7.30.0",
28+
"eslint": "^8.0.0",
2929
"execa": "1.0.0",
3030
"fs-extra": "^9.0.1",
3131
"get-port": "^5.1.1",

Diff for: packages/eslint-config-react-app/README.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ The easiest way to use this configuration is with [Create React App](https://git
1616

1717
If you want to use this ESLint configuration in a project not built with Create React App, you can install it with the following steps.
1818

19-
First, install this package, ESLint and the necessary plugins. Note that when using npm 7 (or greater) this step is not required, as npm will automatically install peer dependencies.
19+
First, install this package and ESLint.
2020

2121
```sh
22-
npm install --save-dev eslint-config-react-app @babel/eslint-parser@^7.14.7 @typescript-eslint/eslint-plugin@^4.0.0 @typescript-eslint/parser@^4.0.0 babel-preset-react-app@^10.0.0 eslint@^7.5.0 eslint-plugin-flowtype@^5.2.0 eslint-plugin-import@^2.22.0 eslint-plugin-jsx-a11y@^6.3.1 eslint-plugin-react@^7.20.3 eslint-plugin-react-hooks@^4.0.8
22+
npm install --save-dev eslint-config-react-app eslint@^8.0.0
2323
```
2424

2525
Then create a file named `.eslintrc.json` with following contents in the root folder of your project:
@@ -36,13 +36,7 @@ That's it! You can override the settings from `eslint-config-react-app` by editi
3636

3737
This config also ships with optional Jest rules for ESLint (based on [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest)).
3838

39-
You'll first need to add the ESLint plugin for Jest (if you don't already have it installed).
40-
41-
```sh
42-
npm install --save-dev eslint-plugin-jest@^24.0.0 eslint-plugin-testing-library@^3.9.0
43-
```
44-
45-
You can then enable these rules by adding the Jest config to the `extends` array in your ESLint config.
39+
You can enable these rules by adding the Jest config to the `extends` array in your ESLint config.
4640

4741
```json
4842
{

Diff for: packages/eslint-config-react-app/jest.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,17 @@ module.exports = {
3939
// https://github.com/testing-library/eslint-plugin-testing-library
4040
'testing-library/await-async-query': 'error',
4141
'testing-library/await-async-utils': 'error',
42-
'testing-library/no-await-sync-query': 'warn',
42+
'testing-library/no-await-sync-query': 'error',
43+
'testing-library/no-container': 'error',
44+
'testing-library/no-debug': 'error',
4345
'testing-library/no-dom-import': ['error', 'react'],
46+
'testing-library/no-node-access': 'error',
47+
'testing-library/no-promise-in-fire-event': 'error',
48+
'testing-library/no-unnecessary-act': 'error',
4449
'testing-library/no-wait-for-empty-callback': 'error',
45-
'testing-library/no-wait-for-snapshot': 'error',
50+
'testing-library/prefer-find-by': 'error',
51+
'testing-library/prefer-screen-queries': 'error',
52+
'testing-library/render-result-naming-convention': 'error',
4653
},
4754
},
4855
],

Diff for: packages/eslint-config-react-app/package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
"jest.js"
1818
],
1919
"peerDependencies": {
20-
"eslint": "^7.30.0"
20+
"eslint": "^8.0.0"
2121
},
2222
"dependencies": {
23-
"@babel/core": "7.14.2",
24-
"@babel/eslint-parser": "^7.14.7",
25-
"@rushstack/eslint-patch": "^1.0.6",
26-
"@typescript-eslint/eslint-plugin": "^4.0.0",
27-
"@typescript-eslint/parser": "^4.0.0",
23+
"@babel/core": "^7.15.8",
24+
"@babel/eslint-parser": "^7.15.8",
25+
"@rushstack/eslint-patch": "^1.0.8",
26+
"@typescript-eslint/eslint-plugin": "^5.0.0",
27+
"@typescript-eslint/parser": "^5.0.0",
2828
"babel-preset-react-app": "^10.0.0",
2929
"confusing-browser-globals": "^1.0.10",
30-
"eslint-plugin-flowtype": "^5.2.0",
31-
"eslint-plugin-import": "^2.22.0",
32-
"eslint-plugin-jest": "^24.0.0",
33-
"eslint-plugin-jsx-a11y": "^6.3.1",
34-
"eslint-plugin-react": "^7.20.3",
35-
"eslint-plugin-react-hooks": "^4.0.8",
36-
"eslint-plugin-testing-library": "^3.9.0"
30+
"eslint-plugin-flowtype": "^5.9.2",
31+
"eslint-plugin-import": "^2.25.2",
32+
"eslint-plugin-jest": "^25.0.5",
33+
"eslint-plugin-jsx-a11y": "^6.4.1",
34+
"eslint-plugin-react": "^7.26.1",
35+
"eslint-plugin-react-hooks": "^4.2.0",
36+
"eslint-plugin-testing-library": "^4.12.4"
3737
},
3838
"engines": {
3939
"node": ">=14.0.0"

Diff for: packages/react-error-overlay/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"chalk": "2.4.2",
4545
"chokidar": "^3.5.1",
4646
"cross-env": "7.0.3",
47-
"eslint": "^7.30.0",
47+
"eslint": "^8.0.0",
4848
"eslint-config-react-app": "^6.0.0",
4949
"flow-bin": "^0.116.0",
5050
"html-entities": "1.3.1",

Diff for: packages/react-scripts/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"css-minimizer-webpack-plugin": "3.0.2",
4444
"dotenv": "9.0.2",
4545
"dotenv-expand": "5.1.0",
46-
"eslint": "^7.30.0",
46+
"eslint": "^8.0.0",
4747
"eslint-config-react-app": "^6.0.0",
48-
"eslint-webpack-plugin": "^2.5.4",
48+
"eslint-webpack-plugin": "^3.0.1",
4949
"file-loader": "^6.2.0",
5050
"fs-extra": "^10.0.0",
5151
"html-webpack-plugin": "5.3.2",

0 commit comments

Comments
 (0)