Open julienw opened 1 year ago
I must add that this worked for some files too.
Hello :)
Hoping to revive this issue, especially with React 19 and the update-react-imports
codemod that should gain more traction.
I hit various errors related to "recent" Flow syntax. PropertyDefinition
, but also IndexedAccessType
etc.
It might just be a matter of updating a dependency or two. Most notably ast-types
.
Please see:
https://github.com/facebook/jscodeshift/issues/478
https://github.com/benjamn/ast-types/issues/596
Okay, aftet some time to figure out the new resolutions syntax in Yarn Berry...
I got it working with a local install and resolutions.
"resolutions": {
"jscodeshift": "latest",
"ast-types": "npm:@gkz/ast-types@^0.14.4",
"flow-parser": "0.152"
}
And I guess for npm:
"overrides": {
"jscodeshift": "latest",
"ast-types": "npm:@gkz/ast-types",
"flow-parser": "0.152"
}
Made a temporary repo to help with this issue https://github.com/pascalduez/react-codemod-patched
I tried to run
update-react-imports
on our codebase https://github.com/firefox-devtools/profiler/ (commit hash e8a3afd45a8125de9c37c546f6b50c8004f122e7), and got the following error on several files:It's not clear to me how to debug this further, but hopefully you'll be able to reproduce using code directly.