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

Which types to use while processing ASTs? #60

Open
manuel3108 opened this issue Aug 25, 2024 · 0 comments
Open

Which types to use while processing ASTs? #60

manuel3108 opened this issue Aug 25, 2024 · 0 comments

Comments

@manuel3108
Copy link

When using normal acorn we have the possibility to use @types/estree while processing the ast to get some kind of type safety. Of course this only works if the processing happens on a TS or JSDOC project, but that's on another note.

We would like to do some AST post processing with this library in a type safe manner. Sadly @types/estree does not contain any relevant information about the TS nodes, and such does the specification.

So the first question is: Based on which specification are the TS nodes emitted by this tool generated?

The closest tool I could find that also publishes estree specific TS Nodes to it's ast is @typescript-eslint/types. Annoyingly they have some minor but noticeable differences that make working with types pretty annoying.

I also had a look at this project's source code, but for me it looks like the generated nodes are mainly untyped. Is that correct, or am I just missing some post checkout steps?

And that's where my second question comes into play: Are you aware of any defined types that properly represent the AST Nodes generated by this project?

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

1 participant