Skip to content

ref(lint): Enable no-unnecessary-type-assertion - #2125

Merged
betegon merged 3 commits into
mainfrom
josh/lint-no-unnecessary-type-assertion
Nov 10, 2026
Merged

betegon merged 3 commits into
mainfrom
josh/lint-no-unnecessary-type-assertion

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Turns on typescript/no-unnecessary-type-assertion and removes the casts it flags, almost all through oxlint's autofix.

Logger and toolkit-core now enable noUncheckedIndexedAccess, matching how the CLI already typechecks their source, so the lint and the typecheck agree on which assertions are needed.

@JoshuaKGoldberg

Copy link
Copy Markdown
Member Author

@cursor review

@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 10, 2026 8:45pm UTC

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 50981e3. Configure here.

@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review November 10, 2026 14:19
Fixes new assertion hits from main and annotates an eval array so the rule agrees whether or not workspace packages are built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 10, 2026
@betegon
betegon enabled auto-merge (squash) November 10, 2026 20:48
@betegon
betegon merged commit aa54af1 into main Nov 10, 2026
45 checks passed
@betegon
betegon deleted the josh/lint-no-unnecessary-type-assertion branch November 10, 2026 20:55
sentry-junior Bot added a commit that referenced this pull request Nov 10, 2026
Resolves the stdio-setup.tsx modify/delete conflict by taking main's deletion (replaced by cli-setup.tsx in #1981), and drops an unnecessary `as typeof fetch` in sentry-client.test.ts that #2152 added and that fails the no-unnecessary-type-assertion rule enabled in #2125.
MathurAditya724 added a commit that referenced this pull request Nov 15, 2026
…in (#2277)

Removes the `!` from `return requests[0]!;` in the search-events tests.
#2146 added it on a branch that predates
#2125, which made unnecessary type assertions an error,
so main has rejected it since 88c26a3e.

The return type is still `URLSearchParams`. Nothing else changes.

<!-- junior-request-attribution:start -->
via @MathurAditya724.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A4c096bdc12f2a2226186d683 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A4c096bdc12f2a2226186d683)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A4c096bdc12f2a2226186d683/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Aditya Mathur <[email protected]>

This branch was successfully deployed

2 active deployments
Preview — 008b7e7d Deployed Nov 10, 2026 by vercel[bot]
Actions — 008b7e7d Deployed Nov 10, 2026 by sentry-junior[bot] via eval #1782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants