Skip to content

Enable @typescript-eslint/prefer-includes - #302

Merged
ryanhugh merged 7 commits into
mainfrom
claude/round4-prefer-includes
Aug 13, 2026
Merged

Enable @typescript-eslint/prefer-includes#302
ryanhugh merged 7 commits into
mainfrom
claude/round4-prefer-includes

Conversation

@ryanhugh

Copy link
Copy Markdown
Member

Adds "@typescript-eslint/prefer-includes": "error" to the type-aware rules block of eslint.config.mjs.

Violations: 1, auto-fixed.

The fix

scrapers/myChart/__tests__/http.unit.test.ts — the Sec-Ch-Ua brand filter:

- const chromeBrands = brands.filter(([, brand]) => /Chrom/.test(brand!))
+ const chromeBrands = brands.filter(([, brand]) => (brand!).includes('Chrom'))

Behavior analysis: behavior-neutral. Chrom is a bare literal regex — no anchors, no metacharacters, no flags — so /Chrom/.test(s) and s.includes('Chrom') are the same substring test on every input. The rule also covers the indexOf(...) !== -1 idiom repo-wide going forward.

Verified: npx eslint . clean, bun run typecheck clean, bun run test 1514 pass / 0 fail.

🤖 Generated with Claude Code

ryanhugh and others added 2 commits August 13, 2026 13:33
One violation, auto-fixed: a bare-literal regex test in
http.unit.test.ts becomes a String#includes call with identical
semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryanhugh
ryanhugh enabled auto-merge (squash) August 13, 2026 17:53
@ryanhugh
ryanhugh merged commit 61229e6 into main Aug 13, 2026
2 checks passed
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