-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(typescript-estree): persisted parse and module none #1521
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
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a net positive.
It adds a small amount of complexity, but it means we can never mess it up by forgetting a getTypeChecker call
const compilerHost = ts.createCompilerHost(commandLine.options, true); | ||
const compilerHost = ts.createCompilerHost( | ||
commandLine.options, | ||
/* setParentNodes */ true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to set this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be needed anymore
@@ -46,7 +46,7 @@ function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram { | |||
filename, | |||
code, | |||
ts.ScriptTarget.Latest, | |||
true, | |||
/* setParentNodes */ true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Codecov Report
@@ Coverage Diff @@
## master #1521 +/- ##
==========================================
- Coverage 95.57% 95.49% -0.08%
==========================================
Files 149 150 +1
Lines 6685 6636 -49
Branches 1913 1878 -35
==========================================
- Hits 6389 6337 -52
Misses 112 112
- Partials 184 187 +3
|
make sure to validate all lines if i'm passing correct property as parent (i know its huge) |
I eyeballed it all and it looked fine. |
TBF as well, there's only 6 instances of |
I did some additional testing, and it seems that we need parent nodes, than this change is not going to work, .parent is mostly used by tsutils and if i turn off parent nodes its starting to fail first place where it actually fails is comment generation as this relies on parents, i will recommend for now just go with #1516 or some variation of it (mayby we could limit number of calls by checking if first node has parent?) |
😢 That sucks. I didn't even think about the fact that tsutils uses parent. |
than i'm closing this one as it will not work 😿 |
This is alternative (more extensive) change to how converter generates AST, this change simply removes needs of parent propagation for conversion logic.
This change contains history from #1516, and its described in #1516 (comment)
fixes #1502