Skip to content

Ratchet unicorn/better-dom-traversing + prefer-number-is-safe-integer to error#280

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-dom-traversal
Jun 22, 2026
Merged

Ratchet unicorn/better-dom-traversing + prefer-number-is-safe-integer to error#280
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-dom-traversal

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

First ratchet from #279 — the smallest, lowest-risk pair.

Changes

  • src/lib/page-tree.ts: .childNodes[0].firstChild (2 sites). .firstChild returns ChildNode | null while getElementTree returns Node | undefined, so the return coerces nullundefined. Behaviorally identical (childNodes[0]firstChild).
  • src/lib/background/lifecycle.ts: Number.isInteger(tabId)Number.isSafeInteger(tabId) (2 sites). Tab IDs are well within safe-integer range, so this is strictly more correct.
  • eslint.config.js: both rules removed from the warn list, reverting to their unicorn/recommended default (error).

Verification

  • bun run typecheck clean
  • bun run check exit 0 (the two rules now error; 0 errors remain)
  • bun run test — 2059/2059 pass

Refs #279

… to error

First ratchet from #279. Both are small, source-only, zero-risk:

- page-tree.ts: `.childNodes[0]` → `.firstChild` (coerce the null the
  property returns to undefined to match `getElementTree`'s return type).
- lifecycle.ts: `Number.isInteger(tabId)` → `Number.isSafeInteger(tabId)`
  at the two tab-id guards.

Both rules drop back to their unicorn/recommended default (error).

Refs #279

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 22, 2026 10:54am

Request Review

@twschiller twschiller merged commit 2a03e72 into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-unicorn-dom-traversal branch June 22, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant