Skip to content

Use ts.getParseTreeNode before getSourceFile to handle transformer output#1010

Merged
Perryvw merged 2 commits intomasterfrom
getParseTreeNode
Apr 2, 2021
Merged

Use ts.getParseTreeNode before getSourceFile to handle transformer output#1010
Perryvw merged 2 commits intomasterfrom
getParseTreeNode

Conversation

@Perryvw
Copy link
Copy Markdown
Member

@Perryvw Perryvw commented Mar 30, 2021

AST Nodes transformed with a TS transformer did not set the parent of the new or updated node, causing getSourceFile() to return undefined. ts.getParseTreeNode will try to look up the original node if no parent is available. If no 'original' node was found, it returns the node itself or undefined.

I also ran a npm audit fix.

@Perryvw Perryvw requested a review from lolleko April 1, 2021 19:48
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

Successfully merging this pull request may close these issues.

2 participants