tsx cannot find property
linddxxx opened this issue · comments
linddxxx commented
import jscodeshift from "jscodeshift";
const jsc= jscodeshift.withParser("tsx")
const properties = jsc("const a={b:1};").find(jsc.Property);
properties cannot find property b
Elon Volo commented
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
Haroen Viaene commented
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