Ratchet unicorn 72 suppressions; disable prefer-dom-node-html-methods - #368
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
The
eslint-plugin-unicorn71→72 bump (#365) parked 19 existing violations of two newly-recommended rules inextension/eslint-suppressions.jsonrather 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, stayserror). 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.tsunicorn/prefer-dom-node-html-methods— not a good fit, turned off ineslint.config.js. The rule rewrites.innerHTMLreads toelement.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 throwgetHTML is not a functionat runtime (same test-runtime blocker as the already-offprefer-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.skills/if rules or trace layout changed — n/aCLA
🤖 Generated with Claude Code