Skip to content

fix(lint/no-duplicate-type-constituents): avoid panic when fixing a duplicate after a template literal type - #1137

Merged
camc314 merged 1 commit into
mainfrom
fix/lint-no-duplicate-type-constituents-template-literal
Nov 29, 2026
Merged

camc314 merged 1 commit into
mainfrom
fix/lint-no-duplicate-type-constituents-template-literal

Conversation

@camc314

@camc314 camc314 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1389 to tsrs.

The fixer scanned from the start of the union to find the separator before a duplicate. Our scanner does not rescan a template literal type's } as a template continuation, so an earlier template literal type could consume later separators and panic:

type T = `x${string}y` | number | number;

Start the scan at the end of the previous sibling, matching tsgolint 840816e9. This refreshes the rule baseline to that commit and adds the upstream case.

Copilot AI balanced review requested due to automatic review settings November 29, 2026 16:07

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 29, 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-29T16:09:12.544277Z 7c40555 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 29, 2026 16:09
@camc314
camc314 added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 312ffc5 Nov 29, 2026
75 checks passed
@camc314
camc314 deleted the fix/lint-no-duplicate-type-constituents-template-literal branch November 29, 2026 16:22
@codspeed

codspeed Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 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

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing fix/lint-no-duplicate-type-constituents-template-literal (7c40555) with main (2eea505)

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 2eea5058b672 β†’ PR merge bd854534d031 (head 7c40555ac38b)

Clef gate: Clef estimated 20.2% default and single-threaded wall time, 12.5% peak RSS, 16.8% 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.3% 0.000% +0.4% -0.1%
vscode incremental +0.3% -0.001% +0.4% +0.1%
xstate-main check +0.1% -0.001% -0.2% +0.4%
xstate-main incremental -0.2% -0.002% -2.6% +0.4%
webpack check -0.6% -0.002% +1.9% -0.1%
webpack incremental -0.2% +0.001% -0.9% -0.1%
mui-docs check +0.1% +0.006% -2.8% -0.3%
mui-docs incremental +0.2% -0.022% +0.1% +0.3%
Compiler check -0.6% 0.000% -1.2% -0.1%
Compiler incremental -0.3% 0.000% -0.2% -1.4%
Compiler-Unions check -0.7% 0.000% -1.7% -0.6%
Compiler-Unions incremental +1.0% +0.001% -2.2% -0.2%
cal-diy check -0.1% -0.003% -0.4% +0.1%
cal-diy incremental -0.5% +0.003% -1.3% -0.4%
formbricks-web check -0.2% +0.003% +0.7% -0.4%
formbricks-web incremental +0.7% -0.003% +0.5% 0.0%
supabase-studio check -0.3% -0.002% -0.9% 0.0%
supabase-studio incremental +0.4% +0.004% +0.3% 0.0%
t3code-server check -0.1% -0.004% +0.3% +0.2%
t3code-server incremental 0.0% 0.000% -0.4% 0.0%
mikro-orm check 0.0% -0.001% +0.5% +0.1%
mikro-orm incremental -0.9% -0.002% +0.5% +0.3%
next-packages-next check +0.1% -0.001% +0.4% -0.2%
next-packages-next incremental +0.4% 0.000% +0.6% 0.0%
next-root check +0.1% 0.000% +1.5% +0.2%
next-root incremental 0.0% +0.002% +1.1% 0.0%
storybook check -0.3% 0.000% -0.2% -0.1%
storybook incremental +0.4% -0.004% -0.1% -0.5%
nuxt check -0.5% +0.001% +2.2% -0.3%
nuxt incremental +0.2% +0.003% -1.3% -0.2%
playwright check +0.3% 0.000% +2.3% -0.9%
playwright incremental -0.3% +0.002% -0.2% -0.4%
drizzle-orm check -0.1% +0.006% -2.7% -0.4%
drizzle-orm incremental -0.2% 0.000% -0.7% -0.7%
typeorm check +1.1% 0.000% +0.8% +0.8%
typeorm incremental -0.5% +0.002% +1.9% -0.1%
date-fns check +1.0% -0.014% -3.8% +0.1%
date-fns incremental -0.3% -0.002% +1.5% -0.1%
opencode-core check -0.2% -0.015% -0.6% -2.2%
opencode-core incremental +0.2% -0.004% +0.2% +0.2%
lobehub check -0.1% +0.001% +0.3% 0.0%
lobehub incremental +0.3% +0.009% +0.3% -0.1%
sentry check +0.3% +0.003% +0.4% +0.2%
sentry incremental -0.2% -0.001% 0.0% -0.3%

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.349 β†’ 8.379 82,128,586,048.5 β†’ 82,129,224,001 1.447 β†’ 1.457 1844.0 β†’ 1841.4
vscode incremental 8.515 β†’ 8.565 84,547,609,121.5 β†’ 84,547,362,893 1.640 β†’ 1.651 2159.9 β†’ 2161.1
xstate-main check 0.509 β†’ 0.509 5,548,913,119.5 β†’ 5,548,876,442.5 0.126 β†’ 0.125 242.4 β†’ 243.5
xstate-main incremental 0.531 β†’ 0.533 5,710,582,657.5 β†’ 5,710,465,442 0.162 β†’ 0.160 243.4 β†’ 244.3
webpack check 0.919 β†’ 0.914 10,796,655,319 β†’ 10,796,361,815.5 0.200 β†’ 0.201 405.3 β†’ 404.8
webpack incremental 0.957 β†’ 0.955 11,019,030,862 β†’ 11,019,528,264 0.242 β†’ 0.240 403.6 β†’ 403.2
mui-docs check 2.397 β†’ 2.411 33,018,032,018 β†’ 33,019,594,801.5 0.965 β†’ 0.926 1201.0 β†’ 1196.9
mui-docs incremental 2.485 β†’ 2.486 34,382,480,569.5 β†’ 34,375,109,462.5 1.088 β†’ 1.090 1160.1 β†’ 1163.4
Compiler check 0.142 β†’ 0.141 1,749,407,677.5 β†’ 1,749,407,262 0.064 β†’ 0.064 78.2 β†’ 78.1
Compiler incremental 0.147 β†’ 0.146 1,763,791,043.5 β†’ 1,763,784,418.5 0.067 β†’ 0.068 80.8 β†’ 79.7
Compiler-Unions check 0.199 β†’ 0.197 3,018,740,293 β†’ 3,018,753,818.5 0.095 β†’ 0.093 81.9 β†’ 81.4
Compiler-Unions incremental 0.238 β†’ 0.246 3,031,406,547 β†’ 3,031,416,475 0.103 β†’ 0.101 85.1 β†’ 85.0
cal-diy check 2.651 β†’ 2.647 28,829,868,007 β†’ 28,830,062,934.5 0.860 β†’ 0.849 1356.9 β†’ 1358.5
cal-diy incremental 2.705 β†’ 2.691 30,449,083,459 β†’ 30,449,445,126 1.018 β†’ 1.007 1268.1 β†’ 1263.4
formbricks-web check 3.459 β†’ 3.452 37,031,812,763.5 β†’ 37,033,523,181.5 0.892 β†’ 0.895 1584.0 β†’ 1577.7
formbricks-web incremental 3.877 β†’ 3.906 39,632,487,085 β†’ 39,631,754,581 1.204 β†’ 1.212 1624.2 β†’ 1623.9
supabase-studio check 3.651 β†’ 3.641 40,754,066,091 β†’ 40,753,205,445.5 0.928 β†’ 0.920 1312.0 β†’ 1311.5
supabase-studio incremental 3.826 β†’ 3.847 43,704,272,148 β†’ 43,705,728,091.5 1.039 β†’ 1.037 1366.7 β†’ 1366.3
t3code-server check 3.568 β†’ 3.574 40,947,961,736 β†’ 40,946,274,088 1.157 β†’ 1.169 1311.9 β†’ 1313.9
t3code-server incremental 3.564 β†’ 3.564 41,461,081,558.5 β†’ 41,461,840,250.5 1.386 β†’ 1.383 1305.2 β†’ 1304.9
mikro-orm check 4.340 β†’ 4.345 44,287,631,302 β†’ 44,287,802,411 0.918 β†’ 0.919 1282.0 β†’ 1283.9
mikro-orm incremental 4.029 β†’ 3.990 44,599,278,148.5 β†’ 44,598,901,394 0.946 β†’ 0.947 1254.8 β†’ 1258.6
next-packages-next check 1.470 β†’ 1.473 17,341,797,527.5 β†’ 17,341,515,152.5 0.376 β†’ 0.371 562.3 β†’ 561.4
next-packages-next incremental 1.507 β†’ 1.512 17,657,789,824.5 β†’ 17,657,745,291 0.441 β†’ 0.443 564.2 β†’ 564.5
next-root check 1.156 β†’ 1.154 13,954,403,903.5 β†’ 13,954,539,741.5 0.254 β†’ 0.256 433.3 β†’ 434.1
next-root incremental 1.325 β†’ 1.327 14,417,356,497.5 β†’ 14,417,703,481.5 0.351 β†’ 0.351 473.5 β†’ 473.4
storybook check 0.777 β†’ 0.776 8,843,395,277.5 β†’ 8,843,430,230.5 0.202 β†’ 0.200 397.2 β†’ 396.7
storybook incremental 0.807 β†’ 0.808 9,168,509,219.5 β†’ 9,168,280,223 0.246 β†’ 0.246 376.2 β†’ 374.5
nuxt check 0.820 β†’ 0.823 8,476,314,563 β†’ 8,476,320,044.5 0.209 β†’ 0.216 391.8 β†’ 390.6
nuxt incremental 0.890 β†’ 0.891 8,879,430,747.5 β†’ 8,879,486,092 0.248 β†’ 0.249 392.8 β†’ 392.0
playwright check 0.726 β†’ 0.729 7,387,537,653.5 β†’ 7,387,505,807.5 0.195 β†’ 0.197 365.3 β†’ 362.1
playwright incremental 0.708 β†’ 0.702 7,566,060,714 β†’ 7,566,128,555 0.205 β†’ 0.202 340.7 β†’ 339.4
drizzle-orm check 0.509 β†’ 0.507 5,936,258,702 β†’ 5,936,652,587.5 0.172 β†’ 0.166 381.4 β†’ 379.8
drizzle-orm incremental 0.521 β†’ 0.520 6,108,610,044 β†’ 6,108,488,783 0.177 β†’ 0.173 346.7 β†’ 344.4
typeorm check 0.581 β†’ 0.586 6,378,595,469.5 β†’ 6,378,540,070 0.131 β†’ 0.133 227.0 β†’ 228.9
typeorm incremental 0.651 β†’ 0.647 6,767,889,927 β†’ 6,767,996,982.5 0.173 β†’ 0.176 233.9 β†’ 233.7
date-fns check 0.293 β†’ 0.295 3,335,015,930 β†’ 3,334,284,019 0.098 β†’ 0.096 152.1 β†’ 152.2
date-fns incremental 0.305 β†’ 0.303 3,570,885,275.5 β†’ 3,570,907,429.5 0.101 β†’ 0.104 164.8 β†’ 164.6
opencode-core check 2.143 β†’ 2.139 25,299,951,981.5 β†’ 25,295,800,635.5 1.185 β†’ 1.085 1220.0 β†’ 1193.0
opencode-core incremental 2.162 β†’ 2.168 25,669,581,170.5 β†’ 25,668,565,111.5 1.090 β†’ 1.088 1098.0 β†’ 1099.8
lobehub check 16.627 β†’ 16.625 186,368,747,456.5 β†’ 186,370,156,119 5.605 β†’ 5.628 4426.6 β†’ 4425.8
lobehub incremental 17.032 β†’ 17.068 189,989,022,557 β†’ 190,000,338,919.5 7.016 β†’ 7.044 4488.0 β†’ 4484.8
sentry check 7.677 β†’ 7.693 91,689,885,216 β†’ 91,690,856,886.5 1.699 β†’ 1.711 1784.7 β†’ 1788.9
sentry incremental 7.822 β†’ 7.809 93,673,636,155 β†’ 93,674,073,885.5 2.043 β†’ 2.033 1940.4 β†’ 1934.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.4% -0.4% -0.1% 35405, identical
webpack TSRS_FAST=1 +2.0% -0.1% 0.0% 35405, identical
drizzle-orm default -0.5% +0.1% +0.1% 7057, identical
drizzle-orm TSRS_FAST=1 -0.1% 0.0% 0.0% 7057, identical
xstate-main default -1.0% -0.7% +0.1% 6489, identical
xstate-main TSRS_FAST=1 +1.1% +1.4% -0.1% 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.352 β†’ 0.352 1.822 β†’ 1.814 465.1 β†’ 464.5
webpack TSRS_FAST=1 0.349 β†’ 0.355 1.812 β†’ 1.809 464.9 β†’ 464.8
drizzle-orm default 0.215 β†’ 0.213 1.140 β†’ 1.140 403.7 β†’ 404.3
drizzle-orm TSRS_FAST=1 0.213 β†’ 0.212 1.148 β†’ 1.143 404.0 β†’ 403.9
xstate-main default 0.310 β†’ 0.306 1.377 β†’ 1.362 343.7 β†’ 344.2
xstate-main TSRS_FAST=1 0.309 β†’ 0.308 1.353 β†’ 1.367 341.4 β†’ 341.2

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