Skip to content

fix(lint/prefer-includes): suggest non-string indexOf rewrites - #1055

Merged
camc314 merged 1 commit into
mainfrom
codex/prefer-includes-non-string-suggestions
Nov 20, 2026
Merged

camc314 merged 1 commit into
mainfrom
codex/prefer-includes-non-string-suggestions

Conversation

@camc314

@camc314 camc314 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint@c0c11ea from oxc-project/tsgolint#1368.

prefer-includes now autofixes only indexOf calls on string receivers. Other receivers get a preferIncludesSuggestion, because includes() can differ from indexOf() !== -1:

declare const values: number[];
values.indexOf(NaN) !== -1; // false
values.includes(NaN); // true

The prefer-includes baseline was refreshed from the upstream commit while preserving unchanged records. The all-rules fixture changes only its prefer-includes record, and its output matches the Go binary in all four fix-flag modes.

Copilot AI balanced review requested due to automatic review settings November 20, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T15:59:44.695913Z c0a51e7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@camc314
camc314 enabled auto-merge November 20, 2026 15:59
@camc314
camc314 added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 352df37 Nov 20, 2026
20 checks passed
@camc314
camc314 deleted the codex/prefer-includes-non-string-suggestions branch November 20, 2026 16:10
@codspeed

codspeed Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 3.68%

3 warnings

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark with a significant change ran in a different software environment

Its base and head results were measured with a different OS or toolchain, such as compiler, runtime or library versions, so the change might come from this difference rather than from the code. Open the benchmark to see what changed.

See affected benchmarks

⚡ 1 improved benchmark
✅ 7 untouched benchmarks
⏩ 8 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory webpack 85.1 MB 82.1 MB +3.68%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/prefer-includes-non-string-suggestions (c0a51e7) with main (3b3bf43)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main 3b3bf43652b3 → PR merge 3d9b6e5a6f2f (head c0a51e7f317e)

Clef gate: Clef estimated 13.6% default and single-threaded wall time, 9.3% peak RSS, 10.4% single-threaded instruction count impact probability.

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Δ Single-thread instructions Δ Default wall time Δ Default peak RSS Δ
vscode check -0.1% 0.000% -0.2% +0.1%
vscode incremental +1.3% +0.001% +0.1% +0.1%
xstate-main check -0.1% +0.002% -0.9% +0.3%
xstate-main incremental -0.7% +0.002% -2.1% -0.1%
webpack check -0.6% +0.003% -1.1% 0.0%
webpack incremental -0.2% +0.005% +1.4% 0.0%
mui-docs check -1.0% +0.004% -3.3% +0.2%
mui-docs incremental +2.2% -0.012% -3.2% +0.2%
Compiler check +0.1% 0.000% +3.9% +1.9%
Compiler incremental -2.6% 0.000% +0.6% +2.4%
Compiler-Unions check +0.5% -0.001% +5.4% +0.1%
Compiler-Unions incremental +1.6% 0.000% +2.4% -0.1%
cal-diy check +1.4% +0.003% +0.2% +0.6%
cal-diy incremental +1.9% -0.002% +2.2% +0.1%
formbricks-web check +0.2% +0.001% +0.2% +0.1%
formbricks-web incremental -0.8% 0.000% -1.5% +0.3%
supabase-studio check -1.4% -0.003% +0.8% -0.3%
supabase-studio incremental -1.0% +0.003% -3.2% -0.1%
t3code-server check -0.6% +0.001% -0.3% -0.7%
t3code-server incremental -0.1% +0.003% -0.4% +0.1%
mikro-orm check -1.4% 0.000% -2.2% -0.5%
mikro-orm incremental +0.4% +0.002% -0.6% +0.3%
next-packages-next check -0.1% +0.001% +3.8% +0.8%
next-packages-next incremental -0.5% -0.002% -0.9% -0.2%
next-root check +5.4% 0.000% +4.6% +0.6%
next-root incremental +0.4% +0.001% -2.9% -0.1%
storybook check -1.6% -0.001% -3.0% +0.5%
storybook incremental -0.9% -0.004% +7.3% -0.3%
nuxt check +0.7% -0.001% -3.7% 0.0%
nuxt incremental -1.7% -0.002% -0.9% +0.1%
playwright check +6.2% +0.001% +0.5% -2.7%
playwright incremental -3.9% -0.001% -2.2% -0.1%
drizzle-orm check -2.2% 0.000% +0.4% -0.6%
drizzle-orm incremental +0.8% -0.003% -1.1% -0.3%
typeorm check +2.2% +0.001% -2.7% -0.9%
typeorm incremental -0.5% -0.004% -0.5% -0.2%
date-fns check +0.1% -0.019% +3.4% -0.2%
date-fns incremental -0.2% +0.020% +1.9% +0.4%

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.

Measured medians (main → PR)
Project Mode Single-thread wall time (s) Single-thread instructions Default wall time (s) Default peak RSS (MiB)
vscode check 8.647 → 8.582 82,258,247,413.5 → 82,258,997,473 1.440 → 1.430 1838.4 → 1840.1
vscode incremental 9.951 → 9.982 84,673,003,917.5 → 84,673,410,851 1.761 → 1.724 2160.1 → 2162.0
xstate-main check 0.599 → 0.594 5,565,945,885 → 5,566,014,705 0.137 → 0.138 242.7 → 243.5
xstate-main incremental 0.547 → 0.544 5,728,513,692.5 → 5,728,659,266.5 0.167 → 0.165 244.9 → 244.7
webpack check 1.118 → 1.147 10,885,043,007.5 → 10,885,214,143 0.237 → 0.234 405.2 → 405.0
webpack incremental 0.979 → 0.974 11,108,336,062 → 11,108,505,996 0.244 → 0.247 403.0 → 402.9
mui-docs check 2.459 → 2.436 33,109,241,792 → 33,109,974,671.5 1.010 → 0.951 1224.4 → 1227.5
mui-docs incremental 3.063 → 3.142 34,454,011,105 → 34,452,817,985.5 1.367 → 1.317 1159.6 → 1161.5
Compiler check 0.175 → 0.174 1,775,731,551 → 1,775,733,357.5 0.072 → 0.074 76.4 → 77.9
Compiler incremental 0.180 → 0.173 1,788,548,530 → 1,788,538,867.5 0.077 → 0.078 79.7 → 81.6
Compiler-Unions check 0.213 → 0.210 3,053,549,787 → 3,053,514,938.5 0.100 → 0.105 81.1 → 81.2
Compiler-Unions incremental 0.201 → 0.203 3,065,405,228 → 3,065,383,396 0.093 → 0.095 85.1 → 85.1
cal-diy check 3.298 → 3.355 28,971,237,501 → 28,970,954,572.5 0.953 → 0.938 1353.7 → 1362.2
cal-diy incremental 2.801 → 2.966 30,590,315,019 → 30,589,730,180.5 1.102 → 1.105 1266.0 → 1267.3
formbricks-web check 3.380 → 3.384 37,084,788,381 → 37,084,537,124 0.865 → 0.868 1582.6 → 1583.4
formbricks-web incremental 4.465 → 4.441 39,686,136,457.5 → 39,685,846,496 1.274 → 1.245 1623.4 → 1627.5
supabase-studio check 4.378 → 4.361 40,817,896,562 → 40,817,682,704 1.019 → 1.057 1311.6 → 1308.2
supabase-studio incremental 5.164 → 5.183 43,763,579,835.5 → 43,765,111,228.5 1.396 → 1.351 1364.9 → 1363.8
t3code-server check 4.065 → 4.044 41,055,049,707.5 → 41,055,334,480.5 1.683 → 1.697 1458.1 → 1448.4
t3code-server incremental 3.803 → 3.846 41,578,527,217 → 41,579,522,313.5 1.463 → 1.443 1304.1 → 1305.8
mikro-orm check 5.393 → 5.112 44,483,930,949 → 44,484,229,517.5 1.097 → 1.084 1284.2 → 1278.0
mikro-orm incremental 6.072 → 6.029 44,794,199,616.5 → 44,794,592,870 1.209 → 1.255 1256.7 → 1260.1
next-packages-next check 1.653 → 1.666 17,404,332,841.5 → 17,404,712,406 0.411 → 0.418 560.7 → 565.0
next-packages-next incremental 1.582 → 1.578 17,730,657,997.5 → 17,730,117,030.5 0.469 → 0.463 565.3 → 564.2
next-root check 1.677 → 1.840 13,962,809,209 → 13,963,007,397.5 0.301 → 0.314 431.5 → 434.1
next-root incremental 1.456 → 1.482 14,424,755,752.5 → 14,424,673,635.5 0.349 → 0.345 473.3 → 472.8
storybook check 0.983 → 0.981 8,867,182,885 → 8,867,244,061.5 0.233 → 0.226 396.9 → 398.9
storybook incremental 1.029 → 1.031 9,192,557,989.5 → 9,191,906,940 0.309 → 0.324 375.4 → 374.3
nuxt check 1.059 → 1.004 8,500,817,090 → 8,500,725,733.5 0.226 → 0.215 390.9 → 391.1
nuxt incremental 1.399 → 1.387 8,902,473,684.5 → 8,902,425,172 0.337 → 0.329 391.2 → 391.4
playwright check 1.120 → 1.595 7,402,917,892.5 → 7,402,986,870 0.295 → 0.299 364.3 → 354.3
playwright incremental 0.791 → 0.748 7,574,773,278.5 → 7,574,719,685 0.223 → 0.225 340.6 → 340.2
drizzle-orm check 0.601 → 0.625 5,948,412,808 → 5,948,355,449.5 0.198 → 0.183 381.7 → 379.5
drizzle-orm incremental 0.559 → 0.566 6,119,637,061 → 6,119,689,501 0.196 → 0.193 346.0 → 344.9
typeorm check 0.732 → 0.738 6,392,725,921.5 → 6,392,676,072 0.157 → 0.153 228.3 → 226.2
typeorm incremental 0.653 → 0.659 6,769,722,563 → 6,769,531,288 0.317 → 0.321 233.3 → 232.8
date-fns check 0.276 → 0.272 3,347,970,139 → 3,347,487,299.5 0.084 → 0.085 152.9 → 152.6
date-fns incremental 0.346 → 0.344 3,584,125,013.5 → 3,584,902,414.5 0.189 → 0.190 163.4 → 164.0

tsrs-lint

Release tsrs-lint linting each project's source files with all 61 rules. After a warmup run of each binary, alternating main/PR pairs (10 per mode) measure wall time, CPU time and peak RSS with TSRS_FAST unset and with TSRS_FAST=1.

Project Mode Wall time Δ CPU time Δ Peak RSS Δ Diagnostics (main → PR)
webpack default +0.3% +0.3% -0.1% 37258, identical
webpack TSRS_FAST=1 -0.7% +0.6% +0.1% 37258, identical
drizzle-orm default -2.9% -2.0% -0.1% 7057, identical
drizzle-orm TSRS_FAST=1 +2.4% +1.0% -0.1% 7057, identical
xstate-main default +8.1% +6.3% +0.6% 6489, identical
xstate-main TSRS_FAST=1 +6.1% +5.1% -0.8% 6489, identical

Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians.

Measured lint medians (main → PR)
Project Mode Wall time (s) CPU time (s) Peak RSS (MiB)
webpack default 0.394 → 0.393 1.959 → 1.967 467.8 → 467.3
webpack TSRS_FAST=1 0.391 → 0.381 1.996 → 1.949 467.1 → 467.3
drizzle-orm default 0.311 → 0.312 1.637 → 1.631 404.1 → 403.8
drizzle-orm TSRS_FAST=1 0.321 → 0.331 1.659 → 1.692 403.5 → 403.2
xstate-main default 0.404 → 0.451 1.813 → 1.967 340.3 → 342.2
xstate-main TSRS_FAST=1 0.442 → 0.452 1.879 → 1.945 344.4 → 341.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants