-
Notifications
You must be signed in to change notification settings - Fork 41
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
Best way to traverse nodes? #40
Comments
At least it's clear now why the error comes. Gotta figure out how to access the top level of the tree with magicast |
Line 34 in 20da32e
You should be able to access the program node with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm new to the AST world and trying magicast to do some codemod stuff. Currently I'm using
@babel/types#traverse
function which I assumed was the same as@babel/traverse
.When I do this snippet below using
@babel/types#traverse
, things work as intended:But when I swap the traverse method using
@babel/traverse
, program errors out and shows this error:Any ideas what I did wrong? What's the best way to traverse magicast's AST?
The text was updated successfully, but these errors were encountered: