diff --git a/extension/eslint.config.js b/extension/eslint.config.js index 32a9c1d..6a484e0 100644 --- a/extension/eslint.config.js +++ b/extension/eslint.config.js @@ -217,11 +217,6 @@ export default tseslint.config( // narrowing, while an `if`/`else` trips `prefer-ternary`. Would need a // disable, so kept as warn; tracked in #279. "unicorn/prefer-minimal-ternary": "warn", - // prefer-iterator-to-array needs `esnext.iterator` in tsconfig `lib` - // (runtime supports `Iterator#toArray()` at our Chrome 148 / Node 24 - // targets, but it isn't typed under the current `ES2023` lib) — tracked - // in #279. - "unicorn/prefer-iterator-to-array": "warn", "unicorn/no-incorrect-query-selector": "warn", "unicorn/no-top-level-side-effects": "warn", // Partially autofixable — fixable instances are corrected in-tree; the diff --git a/extension/src/lib/background/tab-tracker.ts b/extension/src/lib/background/tab-tracker.ts index 02d75d1..a8bc5d5 100644 --- a/extension/src/lib/background/tab-tracker.ts +++ b/extension/src/lib/background/tab-tracker.ts @@ -282,7 +282,9 @@ export function createTabTracker(): TabTracker { return a.ruleId.localeCompare(b.ruleId); }); const detectionEntries = tabDetections.get(tabId); - const detections = detectionEntries ? [...detectionEntries.values()] : []; + const detections = detectionEntries + ? detectionEntries.values().toArray() + : []; return { entries, detections }; } diff --git a/extension/src/rules/disguised-ad-flag.ts b/extension/src/rules/disguised-ad-flag.ts index ed5febf..1599838 100644 --- a/extension/src/rules/disguised-ad-flag.ts +++ b/extension/src/rules/disguised-ad-flag.ts @@ -431,7 +431,7 @@ function collectCandidates(root: ParentNode): Candidate[] { }); } } - return filterToOutermost([...byArticle.values()], (c) => c.article); + return filterToOutermost(byArticle.values().toArray(), (c) => c.article); } function hideCandidate(candidate: Candidate): void { diff --git a/extension/tsconfig.json b/extension/tsconfig.json index 1434bea..81480ef 100644 --- a/extension/tsconfig.json +++ b/extension/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2023", "module": "ESNext", "moduleResolution": "bundler", - "lib": ["ES2023", "DOM", "DOM.Iterable"], + "lib": ["ES2023", "ESNext.Iterator", "DOM", "DOM.Iterable"], "types": ["chrome", "bun"], "jsx": "react-jsx", "strict": true,