Repository navigation
chore(lint): Forbid non-null assertions in SDK source - #26856
Merged
Merged
Conversation
Enable typescript/no-non-null-assertion for src files. Fix the hits that have a behavior-preserving rewrite and disable the rule with a reason where the assertion is safe by construction. Refs #26852 Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
Contributor
size-limit report 📦Compared: 0c8a477 (PR test merge using develop at cee40e6) Against: cee40e6 (develop) · base run #67873 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 81 successful. See the run.
Successful checks
|
mydea
marked this pull request as ready for review
November 25, 2026 11:02
mydea
approved these changes
Nov 25, 2026
4 of 13 tasks
51 tasks done
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.
What
Enables
typescript/no-non-null-assertionas an error for**/src/**. No runtime or public type changes.Why
This moves the Bugbot rule into Oxlint, as tracked in #26852. Where a rewrite keeps behavior the same (optional chaining after an existing guard,
charAtin bounded string loops,entries(), or a local variable), the assertion is gone. Where the assertion is safe by construction (mandatory regex capture groups, bounded index loops, the guarded descriptor reads inhtmlTreeAsString), it gets anoxlint-disablewith a reason, so browser bundles don't pick up dead fallbacks.dev-packagesturns the rule off for itssrcdirs, since that is test tooling and not SDK source. Thebrowser-utilssrc/metrics/**exemption had nothing left to cover, so it is removed.Part of #26852
via @mydea.
--
View Session [Sentry]