Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Disable 5 unicorn rules that only fire on intentional patterns#288

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-disable-deadends
Jun 22, 2026
Merged

Disable 5 unicorn rules that only fire on intentional patterns#288
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-disable-deadends

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

From #279, following the same call as #287 (no-this-outside-of-class): rules that have no path to error in this repo get turned off rather than left as standing warning noise.

All five were investigated under #279 and confirmed to fire only on deliberate idioms. Each off carries a rationale comment in eslint.config.js:

Rule Why it can't be ratcheted here
no-computed-property-existence-check Flags any obj[dynamicKey] in boolean position, but our hits are value reads (!RULE_DEFAULTS[id], if (states[rule.id]), targetMask[i]), not existence checks. Object.hasOwn would change meaning; no option to narrow.
require-array-sort-compare Every .sort()/.toSorted() site sorts strings (rule ids, permission names) where default lexicographic order is correct.
no-incorrect-query-selector Sole hit is querySelectorAll("#id") used deliberately to count copies (toHaveLength).
prefer-await All sites are the fire-and-forget void promise.then/.catch() idiom (our no-floating-promises convention) in void fns, React effects, event-listener/setTimeout callbacks, and classic-script top-level — none can cleanly take await.
no-top-level-side-effects Sole hit is a deliberate, documented module-load registerMethods({…}).

Change

  • eslint.config.js: the five rules move from warnoff, grouped with a shared rationale block (warn duplicates removed so they don't override).

Verification

  • bun run check exit 0
  • None of the five fire anymore; eslint warnings drop ~268 → ~189

Refs #279

From #279. These rules have no path to `error` in this repo — they fire
only on deliberate idioms — so disable them rather than leave standing
warning noise (per the "no noisy rules" preference). Each carries a
rationale comment in eslint.config.js:

- no-computed-property-existence-check — flags `obj[dynamicKey]` value
  reads (`!RULE_DEFAULTS[id]`, `if (states[rule.id])`), not existence
  checks; no option to narrow.
- require-array-sort-compare — every `.sort()` site sorts strings where
  default order is already correct.
- no-incorrect-query-selector — sole hit is a deliberate
  `querySelectorAll("#id")` copy count.
- prefer-await — flags the fire-and-forget `void p.then/.catch()` idiom
  (our no-floating-promises convention) in contexts that can't take await.
- no-top-level-side-effects — sole hit is a documented module-load
  `registerMethods({…})`.

Drops eslint warnings ~268 → ~189.

Refs #279

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@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 12:23pm

Request Review

@twschiller twschiller merged commit 0e7d664 into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-unicorn-disable-deadends branch June 22, 2026 12:25
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