Open dunnbobcat opened 6 years ago
Which recast version is your jscodeshift installation using (jscodeshift --version
should tell you).
> jscodeshift --version
jscodeshift: 0.5.1
- babel: 6.26.3
- babylon: 7.0.0-beta.47
- flow: 0.74.0
- recast: 0.15.0
You can reproduce the issue with AST explorer: https://astexplorer.net/#/gist/8269fb593017340ed9486d0c57a0a3ff/f30217f92bb6d197ef0bbfdb7eb70c006d9eca6a
Any updates on this?
@fkling, have you had a chance to debug this?
@fkling @dunnbobcat I've reproduced this issue and it only seems to happen with the flow
parser. Running jscodeshift with the vanilla parser works fine.
Friendly ping
This seems to work for as expected in the latest version (v0.6.0), after updating recast. Could you confirm please?
I've got a transform to remove empty object spreads like
...{}
:I'm running it against the following code:
The result of the transform is as follows:
You can see that the closing parenthesis of the conditional spread was removed, resulting in broken syntax. I get the same result if I move the empty object spread above the conditional spread.
I attempted to reproduce the issue in
recast
(0.15.0) directly:But its output is correct: