mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[BE] switch to hermes parser for prettier (#30421)
This will allow us to parse new flow syntax since the `flow` parser is no longer updated. I had to exclude some files and have them fall back to `flow` parser since they contain invalid graphql syntax that makes the plugin crash.
This commit is contained in:
parent
f83615ad30
commit
70484844bf
|
|
@ -21,11 +21,22 @@ compiler/**/__tests__/fixtures/**/*.expect.md
|
||||||
compiler/**/__tests__/fixtures/**/*.flow.js
|
compiler/**/__tests__/fixtures/**/*.flow.js
|
||||||
compiler/**/.next
|
compiler/**/.next
|
||||||
|
|
||||||
|
# contains invalid graphql`...` which results in a promise rejection error from `yarn prettier-all`.
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.todo-kitchensink.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-and-local-variables-with-default.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/destructuring-mixed-scope-declarations-and-locals.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.todo-kitchensink.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-inside-logical-expression.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/optional-call-logical.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls-mutable-lambda.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/readonly-object-method-calls.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/tagged-template-in-hook.js
|
||||||
|
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/tagged-template-literal.js
|
||||||
|
|
||||||
compiler/crates
|
compiler/crates
|
||||||
compiler/apps/playground/public
|
compiler/apps/playground/public
|
||||||
|
|
||||||
compiler/**/LICENSE
|
compiler/**/LICENSE
|
||||||
compiler/.*
|
|
||||||
compiler/*.md*
|
compiler/*.md*
|
||||||
compiler/*.json
|
compiler/*.json
|
||||||
compiler/*.css
|
compiler/*.css
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,13 @@
|
||||||
const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion');
|
const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
plugins: ['prettier-plugin-hermes-parser'],
|
||||||
bracketSpacing: false,
|
bracketSpacing: false,
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
bracketSameLine: true,
|
bracketSameLine: true,
|
||||||
trailingComma: 'es5',
|
trailingComma: 'es5',
|
||||||
printWidth: 80,
|
printWidth: 80,
|
||||||
parser: 'flow',
|
parser: 'hermes',
|
||||||
arrowParens: 'avoid',
|
arrowParens: 'avoid',
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
"monaco-editor": "^0.34.1",
|
"monaco-editor": "^0.34.1",
|
||||||
"next": "^13.5.6",
|
"next": "^13.5.6",
|
||||||
"notistack": "^3.0.0-alpha.7",
|
"notistack": "^3.0.0-alpha.7",
|
||||||
"prettier": "3.0.3",
|
"prettier": "^3.3.3",
|
||||||
"pretty-format": "^29.3.1",
|
"pretty-format": "^29.3.1",
|
||||||
"re-resizable": "^6.9.16",
|
"re-resizable": "^6.9.16",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
|
@ -42,7 +42,6 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "18.11.9",
|
"@types/node": "18.11.9",
|
||||||
"@types/prettier": "^2.7.1",
|
|
||||||
"@types/react": "18.0.25",
|
"@types/react": "18.0.25",
|
||||||
"@types/react-dom": "18.0.9",
|
"@types/react-dom": "18.0.9",
|
||||||
"autoprefixer": "^10.4.13",
|
"autoprefixer": "^10.4.13",
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@
|
||||||
"concurrently": "^7.4.0",
|
"concurrently": "^7.4.0",
|
||||||
"folder-hash": "^4.0.4",
|
"folder-hash": "^4.0.4",
|
||||||
"ora": "5.4.1",
|
"ora": "5.4.1",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.3.3",
|
||||||
|
"prettier-plugin-hermes-parser": "^0.23.0",
|
||||||
"prompt-promise": "^1.0.3",
|
"prompt-promise": "^1.0.3",
|
||||||
"rollup": "^4.13.2",
|
"rollup": "^4.13.2",
|
||||||
"rollup-plugin-banner2": "^1.2.3",
|
"rollup-plugin-banner2": "^1.2.3",
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,9 @@ function Component(props) {
|
||||||
t0 = $[1];
|
t0 = $[1];
|
||||||
}
|
}
|
||||||
const item = t0;
|
const item = t0;
|
||||||
const x = useNoAlias(
|
const x = useNoAlias(item, () => {
|
||||||
item,
|
console.log(props);
|
||||||
() => {
|
}, [props.a]);
|
||||||
console.log(props);
|
|
||||||
},
|
|
||||||
[props.a],
|
|
||||||
);
|
|
||||||
let t1;
|
let t1;
|
||||||
if ($[2] !== x || $[3] !== item) {
|
if ($[2] !== x || $[3] !== item) {
|
||||||
t1 = [x, item];
|
t1 = [x, item];
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ function useFoo(cond) {
|
||||||
t0 = t1;
|
t0 = t1;
|
||||||
const derived1 = t0;
|
const derived1 = t0;
|
||||||
|
|
||||||
const derived2 = cond ?? Math.min(0, 1) ? 1 : 2;
|
const derived2 = (cond ?? Math.min(0, 1)) ? 1 : 2;
|
||||||
let t2;
|
let t2;
|
||||||
let t3;
|
let t3;
|
||||||
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
||||||
|
|
@ -59,7 +59,7 @@ function useFoo(cond) {
|
||||||
t2 = t3;
|
t2 = t3;
|
||||||
const derived3 = t2;
|
const derived3 = t2;
|
||||||
|
|
||||||
const derived4 = Math.min(0, -1) ?? cond ? 1 : 2;
|
const derived4 = (Math.min(0, -1) ?? cond) ? 1 : 2;
|
||||||
let t4;
|
let t4;
|
||||||
if ($[2] !== derived2 || $[3] !== derived4) {
|
if ($[2] !== derived2 || $[3] !== derived4) {
|
||||||
t4 = [derived1, derived2, derived3, derived4];
|
t4 = [derived1, derived2, derived3, derived4];
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function ternary(props) {
|
function ternary(props) {
|
||||||
const a = props.a && props.b ? props.c || props.d : (props.e ?? props.f);
|
const a = props.a && props.b ? props.c || props.d : props.e ?? props.f;
|
||||||
const b = props.a ? (props.b && props.c ? props.d : props.e) : props.f;
|
const b = props.a ? (props.b && props.c ? props.d : props.e) : props.f;
|
||||||
return a ? b : null;
|
return a ? b : null;
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
function ternary(props) {
|
function ternary(props) {
|
||||||
const a = props.a && props.b ? props.c || props.d : props.e ?? props.f;
|
const a = props.a && props.b ? props.c || props.d : (props.e ?? props.f);
|
||||||
const b = props.a ? (props.b && props.c ? props.d : props.e) : props.f;
|
const b = props.a ? (props.b && props.c ? props.d : props.e) : props.f;
|
||||||
return a ? b : null;
|
return a ? b : null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
function ternary(props) {
|
function ternary(props) {
|
||||||
const a = props.a && props.b ? props.c || props.d : (props.e ?? props.f);
|
const a = props.a && props.b ? props.c || props.d : props.e ?? props.f;
|
||||||
const b = props.a ? (props.b && props.c ? props.d : props.e) : props.f;
|
const b = props.a ? (props.b && props.c ? props.d : props.e) : props.f;
|
||||||
return a ? b : null;
|
return a ? b : null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3144,11 +3144,6 @@
|
||||||
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc"
|
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc"
|
||||||
integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==
|
integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==
|
||||||
|
|
||||||
"@types/prettier@^2.7.1":
|
|
||||||
version "2.7.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f"
|
|
||||||
integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==
|
|
||||||
|
|
||||||
"@types/prop-types@*":
|
"@types/prop-types@*":
|
||||||
version "15.7.5"
|
version "15.7.5"
|
||||||
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
|
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
|
||||||
|
|
@ -5812,6 +5807,11 @@ hermes-estree@0.22.0:
|
||||||
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.22.0.tgz#38559502b119f728901d2cfe2ef422f277802a1d"
|
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.22.0.tgz#38559502b119f728901d2cfe2ef422f277802a1d"
|
||||||
integrity sha512-FLBt5X9OfA8BERUdc6aZS36Xz3rRuB0Y/mfocSADWEJfomc1xfene33GdyAmtTkKTBXTN/EgAy+rjTKkkZJHlw==
|
integrity sha512-FLBt5X9OfA8BERUdc6aZS36Xz3rRuB0Y/mfocSADWEJfomc1xfene33GdyAmtTkKTBXTN/EgAy+rjTKkkZJHlw==
|
||||||
|
|
||||||
|
hermes-estree@0.23.0:
|
||||||
|
version "0.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.23.0.tgz#89c5419877b9d6bce4bb616821f496f5c5daddbc"
|
||||||
|
integrity sha512-Rkp0PNLGpORw4ktsttkVbpYJbrYKS3hAnkxu8D9nvQi6LvSbuPa+tYw/t2u3Gjc35lYd/k95YkjqyTcN4zspag==
|
||||||
|
|
||||||
hermes-parser@0.14.0:
|
hermes-parser@0.14.0:
|
||||||
version "0.14.0"
|
version "0.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.14.0.tgz#edb2e7172fce996d2c8bbba250d140b70cc1aaaf"
|
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.14.0.tgz#edb2e7172fce996d2c8bbba250d140b70cc1aaaf"
|
||||||
|
|
@ -5833,6 +5833,13 @@ hermes-parser@0.17.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
hermes-estree "0.17.1"
|
hermes-estree "0.17.1"
|
||||||
|
|
||||||
|
hermes-parser@0.23.0:
|
||||||
|
version "0.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.23.0.tgz#3541907b77ca9e94fd093e8ef0ff97ca5340dee8"
|
||||||
|
integrity sha512-xLwM4ylfHGwrm+2qXfO1JT/fnqEDGSnpS/9hQ4VLtqTexSviu2ZpBgz07U8jVtndq67qdb/ps0qvaWDZ3fkTyg==
|
||||||
|
dependencies:
|
||||||
|
hermes-estree "0.23.0"
|
||||||
|
|
||||||
hermes-parser@^0.19.1:
|
hermes-parser@^0.19.1:
|
||||||
version "0.19.2"
|
version "0.19.2"
|
||||||
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.19.2.tgz#67b0fd92f4d7a374234f58c4f980f816734a7695"
|
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.19.2.tgz#67b0fd92f4d7a374234f58c4f980f816734a7695"
|
||||||
|
|
@ -8469,15 +8476,19 @@ prelude-ls@~1.1.2:
|
||||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||||
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==
|
integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==
|
||||||
|
|
||||||
prettier@*, prettier@^3.2.5:
|
prettier-plugin-hermes-parser@0.23.0, prettier-plugin-hermes-parser@^0.23.0:
|
||||||
version "3.2.5"
|
version "0.23.0"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
|
resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.23.0.tgz#67fa061e503600087169283e150bc3f3239bf39c"
|
||||||
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==
|
integrity sha512-EMwgZFcKDyVfUCvIy/kxVc4siYEOYPt7lLqtaELVadKYNbOLUFjYW3QKGZ8jzidUy4DonfFbi/hJOXJ5vfRzxA==
|
||||||
|
dependencies:
|
||||||
|
hermes-estree "0.23.0"
|
||||||
|
hermes-parser "0.23.0"
|
||||||
|
prettier-plugin-hermes-parser "0.23.0"
|
||||||
|
|
||||||
prettier@3.0.3:
|
prettier@*, prettier@^3.3.3:
|
||||||
version "3.0.3"
|
version "3.3.3"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
|
||||||
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==
|
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
|
||||||
|
|
||||||
pretty-format@^24:
|
pretty-format@^24:
|
||||||
version "24.9.0"
|
version "24.9.0"
|
||||||
|
|
@ -9173,7 +9184,16 @@ string-length@^4.0.1:
|
||||||
char-regex "^1.0.2"
|
char-regex "^1.0.2"
|
||||||
strip-ansi "^6.0.0"
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
"string-width-cjs@npm:string-width@^4.2.0":
|
||||||
|
version "4.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||||
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||||
|
dependencies:
|
||||||
|
emoji-regex "^8.0.0"
|
||||||
|
is-fullwidth-code-point "^3.0.0"
|
||||||
|
strip-ansi "^6.0.1"
|
||||||
|
|
||||||
|
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||||
version "4.2.3"
|
version "4.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||||
|
|
@ -9266,7 +9286,14 @@ string_decoder@^1.1.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer "~5.2.0"
|
safe-buffer "~5.2.0"
|
||||||
|
|
||||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
||||||
|
version "6.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||||
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||||
|
dependencies:
|
||||||
|
ansi-regex "^5.0.1"
|
||||||
|
|
||||||
|
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||||
version "6.0.1"
|
version "6.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||||
|
|
@ -9917,7 +9944,7 @@ wordwrap@>=0.0.2:
|
||||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
|
||||||
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==
|
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==
|
||||||
|
|
||||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
|
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||||
|
|
@ -9935,6 +9962,15 @@ wrap-ansi@^6.2.0:
|
||||||
string-width "^4.1.0"
|
string-width "^4.1.0"
|
||||||
strip-ansi "^6.0.0"
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
|
wrap-ansi@^7.0.0:
|
||||||
|
version "7.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||||
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||||
|
dependencies:
|
||||||
|
ansi-styles "^4.0.0"
|
||||||
|
string-width "^4.1.0"
|
||||||
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
wrap-ansi@^8.1.0:
|
wrap-ansi@^8.1.0:
|
||||||
version "8.1.0"
|
version "8.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"prettier-2": "npm:prettier@^2",
|
"prettier-2": "npm:prettier@^2",
|
||||||
|
"prettier-plugin-hermes-parser": "^0.23.0",
|
||||||
"pretty-format": "^29.4.1",
|
"pretty-format": "^29.4.1",
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"random-seed": "^0.3.0",
|
"random-seed": "^0.3.0",
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ function getHookVariableName(
|
||||||
const nodeType = hook.node.id.type;
|
const nodeType = hook.node.id.type;
|
||||||
switch (nodeType) {
|
switch (nodeType) {
|
||||||
case AST_NODE_TYPES.ARRAY_PATTERN:
|
case AST_NODE_TYPES.ARRAY_PATTERN:
|
||||||
return !isCustomHook ? (hook.node.id.elements[0]?.name ?? null) : null;
|
return !isCustomHook ? hook.node.id.elements[0]?.name ?? null : null;
|
||||||
|
|
||||||
case AST_NODE_TYPES.IDENTIFIER:
|
case AST_NODE_TYPES.IDENTIFIER:
|
||||||
return hook.node.id.name;
|
return hook.node.id.name;
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
|
||||||
id: instance.id,
|
id: instance.id,
|
||||||
type: type,
|
type: type,
|
||||||
parent: instance.parent,
|
parent: instance.parent,
|
||||||
children: keepChildren ? instance.children : (children ?? []),
|
children: keepChildren ? instance.children : children ?? [],
|
||||||
text: shouldSetTextContent(type, newProps)
|
text: shouldSetTextContent(type, newProps)
|
||||||
? computeText((newProps.children: any) + '', instance.context)
|
? computeText((newProps.children: any) + '', instance.context)
|
||||||
: null,
|
: null,
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@
|
||||||
.*/__mocks__/.*
|
.*/__mocks__/.*
|
||||||
.*/__tests__/.*
|
.*/__tests__/.*
|
||||||
|
|
||||||
|
# contains modern flow syntax that requires a Flow upgrade
|
||||||
|
.*/node_modules/prettier-plugin-hermes-parser/.*
|
||||||
|
|
||||||
# TODO: noop should get its own inlinedHostConfig entry
|
# TODO: noop should get its own inlinedHostConfig entry
|
||||||
.*/packages/react-noop-renderer/.*
|
.*/packages/react-noop-renderer/.*
|
||||||
|
|
||||||
|
|
|
||||||
21
yarn.lock
21
yarn.lock
|
|
@ -9133,6 +9133,11 @@ hermes-estree@0.22.0:
|
||||||
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.22.0.tgz#38559502b119f728901d2cfe2ef422f277802a1d"
|
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.22.0.tgz#38559502b119f728901d2cfe2ef422f277802a1d"
|
||||||
integrity sha512-FLBt5X9OfA8BERUdc6aZS36Xz3rRuB0Y/mfocSADWEJfomc1xfene33GdyAmtTkKTBXTN/EgAy+rjTKkkZJHlw==
|
integrity sha512-FLBt5X9OfA8BERUdc6aZS36Xz3rRuB0Y/mfocSADWEJfomc1xfene33GdyAmtTkKTBXTN/EgAy+rjTKkkZJHlw==
|
||||||
|
|
||||||
|
hermes-estree@0.23.0:
|
||||||
|
version "0.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.23.0.tgz#89c5419877b9d6bce4bb616821f496f5c5daddbc"
|
||||||
|
integrity sha512-Rkp0PNLGpORw4ktsttkVbpYJbrYKS3hAnkxu8D9nvQi6LvSbuPa+tYw/t2u3Gjc35lYd/k95YkjqyTcN4zspag==
|
||||||
|
|
||||||
hermes-parser@0.22.0, hermes-parser@^0.22.0:
|
hermes-parser@0.22.0, hermes-parser@^0.22.0:
|
||||||
version "0.22.0"
|
version "0.22.0"
|
||||||
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.22.0.tgz#fc8e0e6c7bfa8db85b04c9f9544a102c4fcb4040"
|
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.22.0.tgz#fc8e0e6c7bfa8db85b04c9f9544a102c4fcb4040"
|
||||||
|
|
@ -9140,6 +9145,13 @@ hermes-parser@0.22.0, hermes-parser@^0.22.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
hermes-estree "0.22.0"
|
hermes-estree "0.22.0"
|
||||||
|
|
||||||
|
hermes-parser@0.23.0:
|
||||||
|
version "0.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.23.0.tgz#3541907b77ca9e94fd093e8ef0ff97ca5340dee8"
|
||||||
|
integrity sha512-xLwM4ylfHGwrm+2qXfO1JT/fnqEDGSnpS/9hQ4VLtqTexSviu2ZpBgz07U8jVtndq67qdb/ps0qvaWDZ3fkTyg==
|
||||||
|
dependencies:
|
||||||
|
hermes-estree "0.23.0"
|
||||||
|
|
||||||
homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
|
homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"
|
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"
|
||||||
|
|
@ -13268,6 +13280,15 @@ prepend-http@^2.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
|
||||||
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
|
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
|
||||||
|
|
||||||
|
prettier-plugin-hermes-parser@0.23.0, prettier-plugin-hermes-parser@^0.23.0:
|
||||||
|
version "0.23.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.23.0.tgz#67fa061e503600087169283e150bc3f3239bf39c"
|
||||||
|
integrity sha512-EMwgZFcKDyVfUCvIy/kxVc4siYEOYPt7lLqtaELVadKYNbOLUFjYW3QKGZ8jzidUy4DonfFbi/hJOXJ5vfRzxA==
|
||||||
|
dependencies:
|
||||||
|
hermes-estree "0.23.0"
|
||||||
|
hermes-parser "0.23.0"
|
||||||
|
prettier-plugin-hermes-parser "0.23.0"
|
||||||
|
|
||||||
prettier@*, prettier@^3.3.3:
|
prettier@*, prettier@^3.3.3:
|
||||||
version "3.3.3"
|
version "3.3.3"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user