Skip to content

Commit 6e10091

Browse files
author
Morten N.O. Henriksen
committed
Fix eslint shareable config using rushstack/eslint-patch
eslint/eslint#3458
1 parent 7130cdf commit 6e10091

File tree

9 files changed

+54
-589
lines changed

9 files changed

+54
-589
lines changed

packages/create-react-app/yarn.lock.cached

Lines changed: 28 additions & 553 deletions
Large diffs are not rendered by default.

packages/eslint-config-react-app/base.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
'use strict';
99

10+
require('./patch');
11+
1012
// This file contains the minimum ESLint configuration required for Create
1113
// React App support, and is used as the `baseConfig` for `eslint-loader`
1214
// to ensure that user-provided configs don't need this boilerplate.

packages/eslint-config-react-app/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
'use strict';
99

10+
require('./patch');
11+
1012
// Inspired by https://github.com/airbnb/javascript but less opinionated.
1113

1214
// We use eslint-loader so even warnings are very visible.

packages/eslint-config-react-app/jest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
'use strict';
99

10+
require('./patch');
11+
1012
// We use eslint-loader so even warnings are very visible.
1113
// This is why we prefer to use "WARNING" level for potential errors,
1214
// and we try not to use "ERROR" level at all.

packages/eslint-config-react-app/package.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@
1414
"files": [
1515
"base.js",
1616
"index.js",
17-
"jest.js"
17+
"jest.js",
18+
"patch.js"
1819
],
19-
"devDependencies": {
20-
"@babel/eslint-parser": "^7.14.7"
21-
},
2220
"peerDependencies": {
21+
"eslint": "^7.30.0"
22+
},
23+
"dependencies": {
24+
"@babel/core": "7.14.2",
2325
"@babel/eslint-parser": "^7.14.7",
26+
"@rushstack/eslint-patch": "^1.0.6",
2427
"@typescript-eslint/eslint-plugin": "^4.0.0",
2528
"@typescript-eslint/parser": "^4.0.0",
2629
"babel-preset-react-app": "^10.0.0",
27-
"eslint": "^7.30.0",
30+
"confusing-browser-globals": "^1.0.10",
2831
"eslint-plugin-flowtype": "^5.2.0",
2932
"eslint-plugin-import": "^2.22.0",
3033
"eslint-plugin-jest": "^24.0.0",
@@ -33,18 +36,7 @@
3336
"eslint-plugin-react-hooks": "^4.0.8",
3437
"eslint-plugin-testing-library": "^3.9.0"
3538
},
36-
"peerDependenciesMeta": {
37-
"eslint-plugin-jest": {
38-
"optional": true
39-
},
40-
"eslint-plugin-testing-library": {
41-
"optional": true
42-
}
43-
},
44-
"dependencies": {
45-
"confusing-browser-globals": "^1.0.10"
46-
},
4739
"engines": {
48-
"node": "^10.12.0 || >=12.0.0"
40+
"node": ">=14.0.0"
4941
}
5042
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
'use strict';
9+
10+
// Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458)
11+
require('@rushstack/eslint-patch/modern-module-resolution');

packages/react-error-overlay/package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"devDependencies": {
3737
"@babel/code-frame": "7.12.13",
3838
"@babel/core": "7.14.2",
39-
"@babel/eslint-parser": "^7.14.7",
4039
"anser": "1.4.10",
4140
"babel-jest": "^26.6.0",
4241
"babel-loader": "8.2.2",
@@ -46,13 +45,6 @@
4645
"cross-env": "7.0.3",
4746
"eslint": "^7.30.0",
4847
"eslint-config-react-app": "^6.0.0",
49-
"eslint-plugin-flowtype": "^5.2.0",
50-
"eslint-plugin-import": "^2.22.1",
51-
"eslint-plugin-jest": "^24.1.0",
52-
"eslint-plugin-jsx-a11y": "^6.3.1",
53-
"eslint-plugin-react": "^7.21.5",
54-
"eslint-plugin-react-hooks": "^4.2.0",
55-
"eslint-plugin-testing-library": "^3.9.2",
5648
"flow-bin": "^0.116.0",
5749
"html-entities": "1.3.1",
5850
"jest": "26.6.0",

packages/react-scripts/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@
2929
"types": "./lib/react-app.d.ts",
3030
"dependencies": {
3131
"@babel/core": "7.14.2",
32-
"@babel/eslint-parser": "^7.14.7",
3332
"@pmmmwh/react-refresh-webpack-plugin": "0.5.0-rc.0",
3433
"@svgr/webpack": "5.5.0",
35-
"@typescript-eslint/eslint-plugin": "^4.5.0",
36-
"@typescript-eslint/parser": "^4.5.0",
3734
"babel-jest": "^26.6.0",
3835
"babel-loader": "8.2.2",
3936
"babel-plugin-named-asset-import": "^0.3.7",
@@ -48,13 +45,6 @@
4845
"dotenv-expand": "5.1.0",
4946
"eslint": "^7.30.0",
5047
"eslint-config-react-app": "^6.0.0",
51-
"eslint-plugin-flowtype": "^5.2.0",
52-
"eslint-plugin-import": "^2.22.1",
53-
"eslint-plugin-jest": "^24.1.0",
54-
"eslint-plugin-jsx-a11y": "^6.3.1",
55-
"eslint-plugin-react": "^7.21.5",
56-
"eslint-plugin-react-hooks": "^4.2.0",
57-
"eslint-plugin-testing-library": "^3.9.2",
5848
"eslint-webpack-plugin": "^2.5.4",
5949
"file-loader": "^6.2.0",
6050
"fs-extra": "^10.0.0",

packages/react-scripts/scripts/utils/verifyPackageTree.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ function verifyPackageTree() {
2323
// These are packages most likely to break in practice.
2424
// See https://github.com/facebook/create-react-app/issues/1795 for reasons why.
2525
// I have not included Babel here because plugins typically don't import Babel (so it's not affected).
26-
'@babel/eslint-parser',
2726
'babel-jest',
2827
'babel-loader',
2928
'jest',

0 commit comments

Comments
 (0)