Skip to content

Commit 5d1e0de

Browse files
committed
Added react-app-rewire-eslint
react-scripts の eslint, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react が重複し、 yarn start 以下のエラーが発生したため、 package.json に resolutions を指定してパッケージをオーバーライド https://stackoverflow.com/questions/40226639/how-do-i-override-nested-dependencies-with-yarn/41082766
1 parent 5914027 commit 5d1e0de

File tree

3 files changed

+26
-112
lines changed

3 files changed

+26
-112
lines changed

config-overrides.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
const rewireStyledComponents = require('react-app-rewire-styled-components');
1+
const rewireEslint = require('react-app-rewire-eslint');
22
const rewireReactHotLoader = require('react-app-rewire-hot-loader');
3+
const rewireStyledComponents = require('react-app-rewire-styled-components');
34

45
module.exports = (config, env) => {
56
let overrodeConfig = Object.assign({}, config);
7+
overrodeConfig = rewireEslint(config, env);
68
overrodeConfig = rewireReactHotLoader(overrodeConfig, env);
79
overrodeConfig = rewireStyledComponents(config, env, {
810
displayName: true,

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"lint-staged": "^7.2.0",
5454
"prettier": "^1.13.7",
5555
"prh": "^5.4.3",
56+
"react-app-rewire-eslint": "^0.2.3",
5657
"react-app-rewire-hot-loader": "^1.0.1",
5758
"react-app-rewire-styled-components": "^3.0.2",
5859
"react-app-rewired": "^1.5.2",
@@ -69,5 +70,11 @@
6970
"textlint-rule-preset-ja-technical-writing": "^3.0.1",
7071
"textlint-rule-prh": "^5.0.1",
7172
"textlint-rule-spellcheck-tech-word": "^5.0.0"
73+
},
74+
"resolutions": {
75+
"eslint": "^4.19.1",
76+
"eslint-plugin-import": "^2.12.0",
77+
"eslint-plugin-jsx-a11y": "^6.0.3",
78+
"eslint-plugin-react": "^7.9.1"
7279
}
7380
}

yarn.lock

Lines changed: 16 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ ajv@^4.7.0:
631631
co "^4.6.0"
632632
json-stable-stringify "^1.0.1"
633633

634-
ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.0, ajv@^5.2.3, ajv@^5.3.0:
634+
ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.3, ajv@^5.3.0:
635635
version "5.5.2"
636636
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
637637
dependencies:
@@ -810,13 +810,6 @@ argparse@^1.0.7:
810810
dependencies:
811811
sprintf-js "~1.0.2"
812812

813-
aria-query@^0.7.0:
814-
version "0.7.1"
815-
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.7.1.tgz#26cbb5aff64144b0a825be1846e0b16cfa00b11e"
816-
dependencies:
817-
ast-types-flow "0.0.7"
818-
commander "^2.11.0"
819-
820813
aria-query@^3.0.0:
821814
version "3.0.0"
822815
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
@@ -1154,12 +1147,6 @@ aws4@^1.6.0:
11541147
version "1.7.0"
11551148
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289"
11561149

1157-
axobject-query@^0.1.0:
1158-
version "0.1.0"
1159-
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0"
1160-
dependencies:
1161-
ast-types-flow "0.0.7"
1162-
11631150
axobject-query@^2.0.1:
11641151
version "2.0.1"
11651152
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.1.tgz#05dfa705ada8ad9db993fa6896f22d395b0b0a07"
@@ -2475,7 +2462,7 @@ buffer@^5.0.3:
24752462
base64-js "^1.0.2"
24762463
ieee754 "^1.1.4"
24772464

2478-
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
2465+
builtin-modules@^1.0.0:
24792466
version "1.1.1"
24802467
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
24812468

@@ -3482,7 +3469,7 @@ d@1:
34823469
dependencies:
34833470
es5-ext "^0.10.9"
34843471

3485-
damerau-levenshtein@^1.0.0, damerau-levenshtein@^1.0.4:
3472+
damerau-levenshtein@^1.0.4:
34863473
version "1.0.4"
34873474
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514"
34883475

@@ -3930,7 +3917,7 @@ elliptic@^6.0.0:
39303917
minimalistic-assert "^1.0.0"
39313918
minimalistic-crypto-utils "^1.0.0"
39323919

3933-
emoji-regex@^6.1.0, emoji-regex@^6.4.1, emoji-regex@^6.5.1:
3920+
emoji-regex@^6.4.1, emoji-regex@^6.5.1:
39343921
version "6.5.1"
39353922
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2"
39363923

@@ -4205,7 +4192,7 @@ [email protected]:
42054192
object-hash "^1.1.4"
42064193
rimraf "^2.6.1"
42074194

4208-
eslint-module-utils@^2.1.1, eslint-module-utils@^2.2.0:
4195+
eslint-module-utils@^2.2.0:
42094196
version "2.2.0"
42104197
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746"
42114198
dependencies:
@@ -4218,22 +4205,7 @@ [email protected]:
42184205
dependencies:
42194206
lodash "^4.15.0"
42204207

4221-
4222-
version "2.8.0"
4223-
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894"
4224-
dependencies:
4225-
builtin-modules "^1.1.1"
4226-
contains-path "^0.1.0"
4227-
debug "^2.6.8"
4228-
doctrine "1.5.0"
4229-
eslint-import-resolver-node "^0.3.1"
4230-
eslint-module-utils "^2.1.1"
4231-
has "^1.0.1"
4232-
lodash.cond "^4.3.0"
4233-
minimatch "^3.0.3"
4234-
read-pkg-up "^2.0.0"
4235-
4236-
eslint-plugin-import@^2.12.0:
4208+
[email protected], eslint-plugin-import@^2.12.0:
42374209
version "2.13.0"
42384210
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.13.0.tgz#df24f241175e312d91662dc91ca84064caec14ed"
42394211
dependencies:
@@ -4248,19 +4220,7 @@ eslint-plugin-import@^2.12.0:
42484220
read-pkg-up "^2.0.0"
42494221
resolve "^1.6.0"
42504222

4251-
4252-
version "5.1.1"
4253-
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz#5c96bb5186ca14e94db1095ff59b3e2bd94069b1"
4254-
dependencies:
4255-
aria-query "^0.7.0"
4256-
array-includes "^3.0.3"
4257-
ast-types-flow "0.0.7"
4258-
axobject-query "^0.1.0"
4259-
damerau-levenshtein "^1.0.0"
4260-
emoji-regex "^6.1.0"
4261-
jsx-ast-utils "^1.4.0"
4262-
4263-
eslint-plugin-jsx-a11y@^6.0.3:
4223+
[email protected], eslint-plugin-jsx-a11y@^6.0.3:
42644224
version "6.1.0"
42654225
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.0.tgz#569f6f2d29546cab82cedaa077ec829693b0c42d"
42664226
dependencies:
@@ -4280,16 +4240,7 @@ eslint-plugin-prettier@^2.6.2:
42804240
fast-diff "^1.1.1"
42814241
jest-docblock "^21.0.0"
42824242

4283-
4284-
version "7.4.0"
4285-
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz#300a95861b9729c087d362dd64abcc351a74364a"
4286-
dependencies:
4287-
doctrine "^2.0.0"
4288-
has "^1.0.1"
4289-
jsx-ast-utils "^2.0.0"
4290-
prop-types "^15.5.10"
4291-
4292-
eslint-plugin-react@^7.9.1:
4243+
[email protected], eslint-plugin-react@^7.9.1:
42934244
version "7.10.0"
42944245
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.10.0.tgz#af5c1fef31c4704db02098f9be18202993828b50"
42954246
dependencies:
@@ -4313,49 +4264,7 @@ eslint-visitor-keys@^1.0.0:
43134264
version "1.0.0"
43144265
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
43154266

4316-
4317-
version "4.10.0"
4318-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.10.0.tgz#f25d0d7955c81968c2309aa5c9a229e045176bb7"
4319-
dependencies:
4320-
ajv "^5.2.0"
4321-
babel-code-frame "^6.22.0"
4322-
chalk "^2.1.0"
4323-
concat-stream "^1.6.0"
4324-
cross-spawn "^5.1.0"
4325-
debug "^3.0.1"
4326-
doctrine "^2.0.0"
4327-
eslint-scope "^3.7.1"
4328-
espree "^3.5.1"
4329-
esquery "^1.0.0"
4330-
estraverse "^4.2.0"
4331-
esutils "^2.0.2"
4332-
file-entry-cache "^2.0.0"
4333-
functional-red-black-tree "^1.0.1"
4334-
glob "^7.1.2"
4335-
globals "^9.17.0"
4336-
ignore "^3.3.3"
4337-
imurmurhash "^0.1.4"
4338-
inquirer "^3.0.6"
4339-
is-resolvable "^1.0.0"
4340-
js-yaml "^3.9.1"
4341-
json-stable-stringify "^1.0.1"
4342-
levn "^0.3.0"
4343-
lodash "^4.17.4"
4344-
minimatch "^3.0.2"
4345-
mkdirp "^0.5.1"
4346-
natural-compare "^1.4.0"
4347-
optionator "^0.8.2"
4348-
path-is-inside "^1.0.2"
4349-
pluralize "^7.0.0"
4350-
progress "^2.0.0"
4351-
require-uncached "^1.0.3"
4352-
semver "^5.3.0"
4353-
strip-ansi "^4.0.0"
4354-
strip-json-comments "~2.0.1"
4355-
table "^4.0.1"
4356-
text-table "~0.2.0"
4357-
4358-
eslint@^4.19.1:
4267+
[email protected], eslint@^4.19.1:
43594268
version "4.19.1"
43604269
resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300"
43614270
dependencies:
@@ -4407,7 +4316,7 @@ espower-location-detector@^1.0.0:
44074316
source-map "^0.5.0"
44084317
xtend "^4.0.0"
44094318

4410-
espree@^3.5.1, espree@^3.5.4:
4319+
espree@^3.5.4:
44114320
version "3.5.4"
44124321
resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
44134322
dependencies:
@@ -5167,7 +5076,7 @@ globals@^11.0.1, globals@^11.1.0:
51675076
version "11.7.0"
51685077
resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673"
51695078

5170-
globals@^9.17.0, globals@^9.18.0:
5079+
globals@^9.18.0:
51715080
version "9.18.0"
51725081
resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
51735082

@@ -6703,11 +6612,7 @@ jsprim@^1.2.2:
67036612
json-schema "0.2.3"
67046613
verror "1.10.0"
67056614

6706-
jsx-ast-utils@^1.4.0:
6707-
version "1.4.1"
6708-
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1"
6709-
6710-
jsx-ast-utils@^2.0.0, jsx-ast-utils@^2.0.1:
6615+
jsx-ast-utils@^2.0.1:
67116616
version "2.0.1"
67126617
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f"
67136618
dependencies:
@@ -6982,10 +6887,6 @@ lodash.clonedeepwith@^4.5.0:
69826887
version "4.5.0"
69836888
resolved "https://registry.yarnpkg.com/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz#6ee30573a03a1a60d670a62ef33c10cf1afdbdd4"
69846889

6985-
lodash.cond@^4.3.0:
6986-
version "4.5.2"
6987-
resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5"
6988-
69896890
lodash.debounce@^4.0.3, lodash.debounce@^4.0.8:
69906891
version "4.0.8"
69916892
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
@@ -9100,6 +9001,10 @@ react-addons-create-fragment@^15.5.3:
91009001
loose-envify "^1.3.1"
91019002
object-assign "^4.1.0"
91029003

9004+
react-app-rewire-eslint@^0.2.3:
9005+
version "0.2.3"
9006+
resolved "https://registry.yarnpkg.com/react-app-rewire-eslint/-/react-app-rewire-eslint-0.2.3.tgz#88e93d74569c33fe22185d46f6a2b521c4dd7fb6"
9007+
91039008
react-app-rewire-hot-loader@^1.0.1:
91049009
version "1.0.1"
91059010
resolved "https://registry.yarnpkg.com/react-app-rewire-hot-loader/-/react-app-rewire-hot-loader-1.0.1.tgz#511f06d85e1c05d3ea1c3cdaede352e1871183ba"

0 commit comments

Comments
 (0)