Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsx cannot find property #510

Open
linddxxx opened this issue Jul 14, 2022 · 2 comments
Open

tsx cannot find property #510

linddxxx opened this issue Jul 14, 2022 · 2 comments

Comments

@linddxxx
Copy link

import jscodeshift from "jscodeshift";

const jsc= jscodeshift.withParser("tsx")
const properties = jsc("const a={b:1};").find(jsc.Property);

properties cannot find property b

@ElonVolo
Copy link
Collaborator

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

@Haroenv
Copy link

Haroenv commented Aug 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants