-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Mark jsxFactorySymbol
as referenced for noUnusedLocals even in verbatimModuleSyntax
#59193
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
7239f8d
to
8697807
Compare
@typescript-bot cherry-pick to release-5.5 |
Hey, @andrewbranch! I've created #59225 for you. |
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 okay, though it does break the abstraction of markLinkedReferences
...
When I was looking at this, what I had found was that the PR that refactored this also modified the behavior to return early from markLinkedReferences
, but the old code did not for JSX and for others.
Maybe that early return is what needs to be modified, like jakebailey@29869a9 ?
(That and all of these functions could be moved inside of markLinkedReferences
to not be directly callable)
Yeah, personally, if we think the |
That had measurably worse performance last I tried, since they all become closures :( |
…e-5.5 (#59225) Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Fixes #59117
markJsxAliasReferenced
itself checkscanCollectSymbolAccessibilityInfo
before marking the symbol asreferenced
for elision purposes (which is not necessary inverbatimModuleSyntax
), but marks the symbol asisReferenced
for unused locals checking purposes beforehand. That needs to happen unconditionally, butmarkLinkedReferences
bails immediately ifcanCollectSymbolAccessibilityInfo
is false.I re-read all the changes in #58366 and tried and failed to break other features in combination with
verbatimModuleSyntax
.