Ratchet unicorn/prefer-iterator-to-array to error#286
Merged
Conversation
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]>
|
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.
Seventh ratchet from #279 (was stacked on #285; now targets
mainsince #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: addESNext.Iteratortolibso iterator-helper methods are typed. Type-only (libhas no emit impact); bothtsconfig.test.json/tsconfig.eslint.jsonextend the base without overridinglib, 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 typecheckclean (toArray now typed)bun run checkexit 0 (rule now errors; 0 violations)bun run test— 2059/2059 passbun run buildsucceeds (type-stripped;libhas no emit impact)Refs #279