Skip to content

Ratchet unicorn 72 suppressions; disable prefer-dom-node-html-methods - #368

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-72-suppressions
Jul 29, 2026
Merged

Ratchet unicorn 72 suppressions; disable prefer-dom-node-html-methods#368
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-72-suppressions

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

Summary

The eslint-plugin-unicorn 71→72 bump (#365) parked 19 existing violations of two newly-recommended rules in extension/eslint-suppressions.json rather than addressing them. This burns that file down to empty ({}) by fixing the rule that's a good fit and turning off the one that isn't.

Changes

  • unicorn/prefer-simple-condition-first — ratcheted (fixed 6 sites, stays error). Reordered each &&/|| so the cheap operand short-circuits first. Every site's operands are pure and independent, so the reorder is behavior-preserving. (The rule ships an autofix but keeps its hand — its message defers the short-circuit-safety check to a human — so the sites were reordered by hand.)
    • src/lib/message-schemas.ts, src/lib/placeholder.ts, src/lib/selector-token-index.ts, src/rules/hidden-text-strip.ts, src/rules/__tests__/encoded-payload-redact.property.test.ts, src/rules/__tests__/form-prefill-annotate.property.test.ts
  • unicorn/prefer-dom-node-html-methods — not a good fit, turned off in eslint.config.js. The rule rewrites .innerHTML reads to element.getHTML(), but for a read the two are equivalent (both serialize light-DOM descendants, both exclude shadow content); getHTML()'s only added value is its shadow-root serialization options, which the fix doesn't pass — so there's no correctness or behavior upside. getHTML() is also a recent DOM API absent from jsdom, and 12 of the 13 hits are jsdom tests asserting on serialized output, so rewriting them would throw getHTML is not a function at runtime (same test-runtime blocker as the already-off prefer-uint8array-base64). The lone production read (serializePageTree) could switch, but only to diverge from every test for no gain.
  • eslint-suppressions.json{}. The ratchet mechanism stays wired up for the next bump.

Testing

CI covers lint/typecheck/knip/tests. Locally: bun run check, bun run typecheck, and the affected suites (338 tests, 18 suites) all green.

  • Manually loaded the extension and exercised the affected rule(s) — n/a, no runtime behavior change (condition reorders are pure; the DOM rule is lint-only)
  • Updated relevant skill docs in skills/ if rules or trace layout changed — n/a

CLA

  • Already signed.

🤖 Generated with Claude Code

The unicorn 71→72 bump (#365) recorded 19 existing violations of two
newly-recommended rules in extension/eslint-suppressions.json instead of
addressing them. Burn the file down to empty.

prefer-simple-condition-first (6 sites): reorder each `&&`/`||` so the
cheap operand short-circuits first. Every site's operands are pure and
independent, so the reordering is behavior-preserving (the rule's own
message defers this check to a human, which is why its autofix stays
its hand). Stays at recommended `error`.

prefer-dom-node-html-methods (13 sites): turned off. The rule rewrites
`.innerHTML` reads to `element.getHTML()`, but for a read the two are
equivalent — getHTML()'s only added value is its shadow-root
serialization options, which the fix doesn't pass. getHTML() is also a
recent DOM API absent from jsdom, and 12 of the 13 hits are jsdom tests
asserting on serialized output, so the rewrite would throw at runtime
(same test-runtime block as prefer-uint8array-base64). No upside.

check + typecheck + affected tests (338) green.

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

vercel Bot commented Jul 29, 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 Jul 29, 2026 2:10pm

Request Review

@twschiller
twschiller merged commit 610f7d0 into main Jul 29, 2026
7 checks passed
@twschiller
twschiller deleted the ratchet-unicorn-72-suppressions branch July 29, 2026 14:36
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