-
Notifications
You must be signed in to change notification settings - Fork 56
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
Generating a typescript file #701
Comments
Did you find anything? |
how do you get types in the estree AST anyway? |
using acorn-ts |
why use a package name that doesn’t exist 🤷♂️ that’s called
A TypeScript AST sounds like it’s not estree. |
yeah thats why I closed this issue... you will probably have to write your own generator, if you want to use it |
Thanks for raising that up @yxshv. Being able to generate TypeScript annotations is indeed a useful feature to add. Astring being ESTree-based, it should use an extension of it, such as the one produced by Eslint's TypeScript parser, which adds |
Hi @davidbonnet, First of all, thank you for this amazing library! It has been incredibly useful. I wanted to suggest adding native TypeScript support to astring. To explore this, I developed a generator that enables TypeScript support for ASTs generated by While my generator works well, I believe it would be more beneficial to integrate this functionality directly into astring. If you find my approach interesting, I’d be happy to contribute by creating a PR to add native TypeScript support. Let me know your thoughts! Best regards, |
I generated the
ast
of a typescript react code usingacorn
andacorn-ts
plugin...But i am not sure how to generate a tsx code, and not sure if its possible with
astring
The text was updated successfully, but these errors were encountered: