-
Notifications
You must be signed in to change notification settings - Fork 34
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
Out of the box JSX/react support? #148
Comments
Any advice on this? Sorry to bug but I would love to use this package but this issue is leaving me dead in the water. |
@dptoot - Can you make a small demo repo that I could poke at? I think in general, we need to update the parser to use your own |
Absolutely! let me get that to you. |
@rwjblue here is an example repo. I have 1 transform that should just change the import name |
@rwjblue Honestly... hacking at the source code I can get this to work by changing https://github.com/rwjblue/codemod-cli/blob/master/src/transform-support.js#L15
I think there just needs to be a way to let the user specify which recast parser to use. I couldn't see anyway in the documentation and this line looks as though it defaults it to typescript. |
ok further update... I can get JSX to parse by not using the parser update method used in the cli generated transform file .
should the getParser method accept a parser type? That would make sense to me to allow you to easily switch any of the recast parsers? Or maybe even a custom parser? |
Something like
|
Ya, I think we should make |
that would be awesome. I would love to have the cli auto detect and save me from updating each generated file |
Great utility. I am was able to generate a package and have some initial working codemods but as soon as there is a test file with a react element then there is an error thrown. Is there JSX support out of the box or do I need to do something to enable?
component,input.js
Error:
The text was updated successfully, but these errors were encountered: