jscodeshift
jscodeshift copied to clipboard
tsx cannot find property
import jscodeshift from "jscodeshift";
const jsc= jscodeshift.withParser("tsx")
const properties = jsc("const a={b:1};").find(jsc.Property);
properties cannot find property b
Away from computer so I haven't yet validated that this works, but try changing Property to ObjectProperty
I believe the node type got changed on babel 6.
https://github.com/babel/babel/blob/main/.github/CHANGELOG-v6.md
I'm getting weird behaviour that in the jscodeshift test utils the type is called a Property
, but when running the code for real it's ObjectProperty
, I wonder why