-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Fix getChildCount/At methods in EndOfFileTokens #44991
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
Before, they were hardcoded to return `0` and `undefined!`, respectively, but that is inaccurate for `EndOfFileToken`s with attached jsdoc.
} | ||
|
||
public getChildAt(): Node { | ||
return undefined!; // TODO: GH#18217 | ||
public getChildAt(index: number): Node { |
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 return Node | undefined
?
TypeScript's codebase chould use the stricter tsconfig flags...
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.
Theoretically, yes, but that's somewhat tangential to this PR
Is there a way to get a quick test added? |
I added a test to |
You can try making the test fail locally as a sanity check which I'd appreciate - maybe each unittest only gets counted as its own test? |
Good point -- the test failed successfully. |
I'm pretty sure unit tests are not part of the 77248 total. They may also run on each process for a parallel test run. |
Before, they were hardcoded to return
0
andundefined!
, respectively, but that is inaccurate forEndOfFileToken
s with attached jsdoc.Fixes #44990