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

Skip to content

Ratchet unicorn/prefer-iterator-to-array to error#286

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-iterator-to-array
Jun 22, 2026
Merged

Ratchet unicorn/prefer-iterator-to-array to error#286
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-iterator-to-array

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

Seventh ratchet from #279 (was stacked on #285; now targets main since #285 merged).

Unblocks the rule #285 deferred. Iterator#toArray() already runs at our targets (Chrome 148 / Node 24) — only the type lib was hiding it.

Changes

  • tsconfig.json: add ESNext.Iterator to lib so iterator-helper methods are typed. Type-only (lib has no emit impact); both tsconfig.test.json / tsconfig.eslint.json extend the base without overriding lib, so it propagates.
  • tab-tracker.ts, disguised-ad-flag.ts: [...map.values()]map.values().toArray().
  • eslint.config.js: removed from the warn list (and its deferral comment) → reverts to unicorn/recommended default (error).

Verification

  • bun run typecheck clean (toArray now typed)
  • bun run check exit 0 (rule now errors; 0 violations)
  • bun run test — 2059/2059 pass
  • bun run build succeeds (type-stripped; lib has no emit impact)

Refs #279

Seventh ratchet from #279. Stacked on the prefer-short-arrow-method PR.

Add `ESNext.Iterator` to tsconfig `lib` so `Iterator#toArray()` is typed
(it already runs at our Chrome 148 / Node 24 targets; only the ES2023 lib
was hiding it), then convert the two temporary-spread sites:

- tab-tracker.ts: `[...detectionEntries.values()]` → `.values().toArray()`
- disguised-ad-flag.ts: `[...byArticle.values()]` → `.values().toArray()`

Rule reverts to its unicorn/recommended default (error).

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:09pm

Request Review

@twschiller twschiller merged commit 09f1f70 into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-unicorn-iterator-to-array branch June 22, 2026 12:12
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