fix(web): remove unnecessary double type cast in unified-diff-view#761
Merged
Merged
Conversation
The EventMap onClick handler from react-diff-view already provides React.MouseEvent<HTMLElement> which includes shiftKey — the `as unknown as MouseEvent` double cast was unnecessary tech debt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
as unknown as MouseEventdouble-cast inunified-diff-view.tsxgutter click handlerEventMaptype fromreact-diff-viewalready providesReact.MouseEvent<HTMLElement>which includesshiftKey— the intermediate cast throughunknownwas unnecessary tech debtWhy this qualifies as tech debt
Double-casting through
unknownbypasses TypeScript's type safety, making it harder to catch real type errors if the upstream library changes its event types. Since the correct type is already available, the cast added noise with no benefit.Next up
The backlog is now empty — next run will re-audit for fresh issues.
🤖 Generated with Claude Code