Parsing imports into generated AST #8254
Closed
chrismooreajbell
started this conversation in
Technical Discussions
Replies: 2 comments
-
Apologies I've updated the original with a more representative code sample. |
Beta Was this translation helpful? Give feedback.
0 replies
-
https://typescript-eslint.io/contributing/discussions/ As per our contributing guide for discussions. We do not use them for questions or support requests. The guide includes alternatives. https://typescript-eslint.io/contributing/issues#questions-and-support-requests |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, this is more of a question than a discussion though it may turn in to that.
Say I have a file with a imports that reference other files:
types.ts
:enums.ts
index.ts
Is there a neat way to grab the original type/enum definitions from
types.ts
andenums.ts
into the AST forindex.ts
? The problem is in this case both appear as type annotations with no context of the originally exported code.A use case for this is that I want to add a fixer to do different things depending on if the exported node is a type or an enum. I guess this is just a general TS parsing question. If this is the wrong place to ask I apologies, I could just use a hand and I'm a bit new to all this 😅
Additional Info
Any additional info...
Before you submit your discussion, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
Beta Was this translation helpful? Give feedback.
All reactions