Skip to content
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

Add lint for unused locals #21364

Merged
merged 1 commit into from
Mar 9, 2022
Merged

Add lint for unused locals #21364

merged 1 commit into from
Mar 9, 2022

Conversation

jryans
Copy link
Collaborator

@jryans jryans commented Mar 9, 2022

TypeScript supports checking for "unused locals", which actually includes
locals, private fields, private methods, etc. If a private thing is actually
needed as part of the API surface, you can change it to public to resolve the
error.

This seems like a good check to have, as it highlights unused bits of code that
perhaps got lost while refactoring. This changes our config to reject them and
fixes up a few existing cases.

See also matrix-org/matrix-react-sdk#8007, matrix-org/matrix-js-sdk#2223


This change is marked as an internal change (Task), so will not be included in the changelog.

TypeScript supports checking for "unused locals", which actually includes
locals, private fields, private methods, etc. If a private thing is actually
needed as part of the API surface, you can change it to public to resolve the
error.

This seems like a good check to have, as it highlights unused bits of code that
perhaps got lost while refactoring. This changes our config to reject them and
fixes up a few existing cases.
@jryans jryans added the T-Task Tasks for the team like planning label Mar 9, 2022
@jryans jryans requested a review from a team as a code owner March 9, 2022 12:06
@jryans jryans enabled auto-merge (squash) March 9, 2022 12:11
@jryans jryans merged commit 2d3757c into develop Mar 9, 2022
@jryans jryans deleted the jryans/no-unused-locals branch March 9, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants