[eslint] Add plugin-proposal-private-methods
There was a bug in our internal Hermes to Babel adapter which caused some malformed AST to be constructed, which babel would then validate as being incorrect. That bug was fixed, but we still have to add this plugin so that private class methods can be parsed by babel. Tested internally
Lauren Tan committed
Jul 27, 2023 at 10:52 UTC
8405d8644fd20758e422aa4fc58ea4a50df5ee3e
3 files changed
+70
-1
compiler/forget/packages/eslint-plugin-react-forget/package.json
+1
@@ -15,6 +15,7 @@
15
},
16
"dependencies": {
17
"@babel/core": "^7.19.1",
18
+ "@babel/plugin-proposal-private-methods": "^7.18.6",
19
"babel-plugin-react-forget": "*",
20
"hermes-parser": "^0.14.0"
21
},
compiler/forget/packages/eslint-plugin-react-forget/src/rules/ReactForgetDiagnostics.ts
+4
-1
@@ -90,7 +90,10 @@ const rule: Rule.RuleModule = {
90
filename,
91
highlightCode: false,
92
retainLines: true,
93
- plugins: [[ReactForgetBabelPlugin, COMPILER_OPTIONS]],
93
+ plugins: [
94
+ ["@babel/plugin-proposal-private-methods", { loose: true }],
95
+ [ReactForgetBabelPlugin, COMPILER_OPTIONS],
96
+ ],
97
sourceType: "module",
98
});
99
} catch (err) {
compiler/forget/yarn.lock
+65
@@ -129,6 +129,13 @@
129
dependencies:
130
"@babel/types" "^7.18.6"
131
132
+"@babel/helper-annotate-as-pure@^7.22.5":
133
+ version "7.22.5"
134
+ resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882"
135
+ integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==
136
+ dependencies:
137
+ "@babel/types" "^7.22.5"
138
+
139
"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6":
140
version "7.22.3"
141
resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.3.tgz#c9b83d1ba74e163e023f008a3d3204588a7ceb60"
@@ -147,6 +154,21 @@
154
lru-cache "^5.1.1"
155
semver "^6.3.0"
156
157
+"@babel/helper-create-class-features-plugin@^7.18.6":
158
+ version "7.22.9"
159
+ resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.9.tgz#c36ea240bb3348f942f08b0fbe28d6d979fab236"
160
+ integrity sha512-Pwyi89uO4YrGKxL/eNJ8lfEH55DnRloGPOseaA8NFNL6jAUnn+KccaISiFazCj5IolPPDjGSdzQzXVzODVRqUQ==
161
+ dependencies:
162
+ "@babel/helper-annotate-as-pure" "^7.22.5"
163
+ "@babel/helper-environment-visitor" "^7.22.5"
164
+ "@babel/helper-function-name" "^7.22.5"
165
+ "@babel/helper-member-expression-to-functions" "^7.22.5"
166
+ "@babel/helper-optimise-call-expression" "^7.22.5"
167
+ "@babel/helper-replace-supers" "^7.22.9"
168
+ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5"
169
+ "@babel/helper-split-export-declaration" "^7.22.6"
170
+ semver "^6.3.1"
171
+
172
"@babel/helper-create-class-features-plugin@^7.19.0":
173
version "7.19.0"
174
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz#bfd6904620df4e46470bae4850d66be1054c404b"
@@ -263,6 +285,13 @@
285
dependencies:
286
"@babel/types" "^7.22.3"
287
288
+"@babel/helper-member-expression-to-functions@^7.22.5":
289
+ version "7.22.5"
290
+ resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2"
291
+ integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==
292
+ dependencies:
293
+ "@babel/types" "^7.22.5"
294
+
295
"@babel/helper-module-imports@^7.18.6":
296
version "7.18.6"
297
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e"
@@ -326,6 +355,13 @@
355
dependencies:
356
"@babel/types" "^7.18.6"
357
358
+"@babel/helper-optimise-call-expression@^7.22.5":
359
+ version "7.22.5"
360
+ resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e"
361
+ integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==
362
+ dependencies:
363
+ "@babel/types" "^7.22.5"
364
+
365
"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0":
366
version "7.19.0"
367
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf"
@@ -374,6 +410,15 @@
410
"@babel/traverse" "^7.19.1"
411
"@babel/types" "^7.19.0"
412
413
+"@babel/helper-replace-supers@^7.22.9":
414
+ version "7.22.9"
415
+ resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz#cbdc27d6d8d18cd22c81ae4293765a5d9afd0779"
416
+ integrity sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==
417
+ dependencies:
418
+ "@babel/helper-environment-visitor" "^7.22.5"
419
+ "@babel/helper-member-expression-to-functions" "^7.22.5"
420
+ "@babel/helper-optimise-call-expression" "^7.22.5"
421
+
422
"@babel/helper-simple-access@^7.18.6":
423
version "7.18.6"
424
resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea"
@@ -402,6 +447,13 @@
447
dependencies:
448
"@babel/types" "^7.20.0"
449
450
+"@babel/helper-skip-transparent-expression-wrappers@^7.22.5":
451
+ version "7.22.5"
452
+ resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847"
453
+ integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==
454
+ dependencies:
455
+ "@babel/types" "^7.22.5"
456
+
457
"@babel/helper-split-export-declaration@^7.0.0", "@babel/helper-split-export-declaration@^7.18.6":
458
version "7.18.6"
459
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075"
@@ -553,6 +605,14 @@
605
"@babel/helper-skip-transparent-expression-wrappers" "^7.20.0"
606
"@babel/plugin-transform-optional-chaining" "^7.22.3"
607
608
+"@babel/plugin-proposal-private-methods@^7.18.6":
609
+ version "7.18.6"
610
+ resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea"
611
+ integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==
612
+ dependencies:
613
+ "@babel/helper-create-class-features-plugin" "^7.18.6"
614
+ "@babel/helper-plugin-utils" "^7.18.6"
615
+
616
"@babel/plugin-proposal-private-property-in-object@^7.21.0":
617
version "7.21.10"
618
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.10.tgz#861ab9c7d152291c47d27838867f27c560f562c4"
@@ -9818,6 +9878,11 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
9878
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
9879
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
9880
9881
+semver@^6.3.1:
9882
+ version "6.3.1"
9883
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
9884
+ integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
9885
+
9886
semver@^7.3.7:
9887
version "7.3.8"
9888
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"