Skip to content

fix(lint/no-mixed-enums): only read members from earlier non-empty enum declarations - #1146

Merged
camc314 merged 1 commit into
mainfrom
fix/lint-no-mixed-enums-earlier-declarations
Nov 29, 2026
Merged

camc314 merged 1 commit into
mainfrom
fix/lint-no-mixed-enums-earlier-declarations

Conversation

@camc314

@camc314 camc314 commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1400 to tsrs.

The rule read the first member of the symbol's first declaration without checking it. That panicked when the first declaration was an empty enum or a namespace, and when the enum had no symbol (an enum inside a with statement):

enum Foo {}
enum Foo {
  A = 1,
}

namespace Bar {
  export const x = 1;
}
enum Bar {
  A = 1,
  B = 'b',
}

with ({}) {
  enum E {
    A = 0,
    B = 'b',
  }
}

Take the first member of the first earlier enum declaration that has members, and otherwise the current declaration's first member, matching tsgolint ddba56df. This refreshes the rule baseline to that commit and adds the upstream cases.

Validation: the no-mixed-enums baseline (54 cases), the no_mixed_enums headless test, cargo clippy -p tsrs_lint --all-targets with warnings denied, and tools/lint/source.mjs.

Copilot AI balanced review requested due to automatic review settings November 29, 2026 17:05

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-29T18:14:40.541969Z 7321541 New commits
ℹ️ 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 force-pushed the fix/lint-no-mixed-enums-earlier-declarations branch from 53a450c to 83df57b Compare November 29, 2026 17:24
@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-mixed-enums-earlier-declarations (7321541) with main (35164b6)

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. ↩

@camc314
camc314 force-pushed the fix/lint-no-mixed-enums-earlier-declarations branch from 83df57b to 7321541 Compare November 29, 2026 18:13
@camc314
camc314 enabled auto-merge November 29, 2026 18:17
@camc314
camc314 added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit ac1fa77 Nov 29, 2026
75 checks passed
@camc314
camc314 deleted the fix/lint-no-mixed-enums-earlier-declarations branch November 29, 2026 18:29
@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main 35164b612180 → PR merge a9e0dc7b29b5 (head 7321541b987e)

Clef gate: Clef estimated 20.7% default and single-threaded wall time, 13.7% peak RSS, 17.2% 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.0% 0.000% -0.3% 0.0%
vscode incremental +0.1% 0.000% +0.6% +0.3%
xstate-main check +0.6% 0.000% -1.0% -0.1%
xstate-main incremental +0.2% 0.000% -0.2% 0.0%
webpack check -0.7% 0.000% +0.4% +0.1%
webpack incremental +0.3% +0.001% -1.3% -0.5%
mui-docs check 0.0% -0.002% +5.2% +2.4%
mui-docs incremental -0.2% +0.012% -0.9% 0.0%
Compiler check +0.7% +0.001% +1.8% +0.3%
Compiler incremental +0.5% +0.001% -1.7% -0.1%
Compiler-Unions check -0.3% 0.000% -0.3% -0.1%
Compiler-Unions incremental -0.6% 0.000% -0.7% +0.2%
cal-diy check +0.1% 0.000% +1.2% -0.6%
cal-diy incremental +0.3% +0.001% +1.1% 0.0%
formbricks-web check -0.4% 0.000% -0.5% 0.0%
formbricks-web incremental -0.1% -0.004% -2.8% 0.0%
supabase-studio check +0.1% 0.000% -0.1% 0.0%
supabase-studio incremental +0.1% 0.000% +0.3% 0.0%
t3code-server check +0.2% -0.001% +0.3% +0.1%
t3code-server incremental -0.3% +0.001% -1.2% +0.1%
mikro-orm check +0.4% -0.001% +0.3% +0.1%
mikro-orm incremental +0.1% -0.002% +0.4% -0.1%
next-packages-next check +0.1% 0.000% +1.0% +0.2%
next-packages-next incremental +0.1% 0.000% +1.4% +0.3%
next-root check +0.3% +0.001% -0.5% 0.0%
next-root incremental -0.6% +0.001% -0.1% +0.1%
storybook check +1.0% 0.000% +0.7% +0.1%
storybook incremental +0.2% -0.001% -0.8% -0.4%
nuxt check +0.1% +0.003% +0.3% +0.6%
nuxt incremental +0.4% +0.001% +2.1% 0.0%
playwright check -1.2% 0.000% -2.1% +0.3%
playwright incremental +0.5% +0.001% +2.1% 0.0%
drizzle-orm check +0.4% -0.001% +5.8% +1.2%
drizzle-orm incremental +0.2% -0.001% -1.0% +0.2%
typeorm check -1.6% +0.002% -0.4% +0.4%
typeorm incremental +0.1% -0.001% -1.4% +0.5%
date-fns check -0.4% +0.002% -0.8% 0.0%
date-fns incremental +0.7% 0.000% -2.5% +0.4%
opencode-core check +0.3% +0.013% +0.3% -0.1%
opencode-core incremental -0.3% 0.000% 0.0% +0.1%
lobehub check -0.2% -0.006% +0.1% +0.1%
lobehub incremental 0.0% +0.003% -0.2% 0.0%
sentry check -0.2% -0.002% -0.4% +0.1%
sentry incremental 0.0% +0.001% -0.6% +0.1%

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.412 → 8.404 81,815,426,312.5 → 81,815,820,593.5 1.456 → 1.454 1804.5 → 1805.3
vscode incremental 8.742 → 8.730 84,217,256,368 → 84,218,120,280 1.710 → 1.712 2122.2 → 2127.8
xstate-main check 0.507 → 0.510 5,520,562,818 → 5,520,568,801 0.124 → 0.124 240.7 → 240.5
xstate-main incremental 0.520 → 0.521 5,679,446,073.5 → 5,679,462,166 0.156 → 0.156 242.1 → 242.2
webpack check 0.924 → 0.920 10,759,922,100 → 10,760,002,853.5 0.200 → 0.199 401.4 → 401.8
webpack incremental 0.949 → 0.952 10,980,150,381.5 → 10,980,298,093.5 0.245 → 0.243 400.8 → 398.8
mui-docs check 2.377 → 2.380 32,889,728,725 → 32,889,991,208 0.933 → 1.010 1181.3 → 1210.0
mui-docs incremental 2.497 → 2.499 34,221,702,402 → 34,224,370,229 1.109 → 1.100 1140.8 → 1140.7
Compiler check 0.147 → 0.153 1,745,223,075 → 1,745,228,837.5 0.069 → 0.070 77.0 → 77.2
Compiler incremental 0.140 → 0.141 1,759,505,111 → 1,759,525,219 0.066 → 0.065 78.4 → 78.4
Compiler-Unions check 0.198 → 0.196 3,014,352,112 → 3,014,359,987 0.094 → 0.093 80.0 → 79.9
Compiler-Unions incremental 0.200 → 0.200 3,026,959,934.5 → 3,026,969,185 0.093 → 0.093 83.6 → 83.8
cal-diy check 2.574 → 2.576 28,707,179,233 → 28,706,498,788.5 0.810 → 0.822 1343.2 → 1334.8
cal-diy incremental 2.742 → 2.745 30,307,454,650 → 30,308,131,824 1.039 → 1.040 1247.9 → 1247.3
formbricks-web check 3.385 → 3.379 36,892,479,142.5 → 36,891,982,310 0.876 → 0.870 1557.2 → 1556.6
formbricks-web incremental 3.607 → 3.632 39,476,557,621 → 39,474,687,904 1.126 → 1.099 1600.5 → 1600.2
supabase-studio check 3.566 → 3.563 40,540,331,831 → 40,540,125,140.5 0.876 → 0.879 1286.5 → 1285.9
supabase-studio incremental 3.965 → 3.965 43,470,601,463 → 43,471,150,254.5 1.078 → 1.081 1344.0 → 1343.5
t3code-server check 3.521 → 3.526 40,781,429,283.5 → 40,781,053,026 1.135 → 1.137 1299.7 → 1301.4
t3code-server incremental 3.586 → 3.572 41,289,497,015.5 → 41,289,709,057 1.406 → 1.395 1294.0 → 1295.4
mikro-orm check 4.127 → 4.144 44,047,328,043 → 44,047,362,106.5 0.853 → 0.858 1254.3 → 1255.8
mikro-orm incremental 3.984 → 3.989 44,356,854,753.5 → 44,356,015,914.5 0.941 → 0.940 1236.4 → 1235.6
next-packages-next check 1.441 → 1.440 17,277,805,677 → 17,277,826,642 0.358 → 0.362 551.5 → 552.4
next-packages-next incremental 1.488 → 1.489 17,589,306,493.5 → 17,589,148,987 0.431 → 0.435 555.1 → 556.5
next-root check 1.157 → 1.160 13,893,328,656.5 → 13,893,494,610.5 0.255 → 0.254 427.5 → 427.4
next-root incremental 1.222 → 1.212 14,350,196,151.5 → 14,350,378,494.5 0.314 → 0.312 467.6 → 468.0
storybook check 0.765 → 0.773 8,812,967,788 → 8,812,974,889 0.199 → 0.200 389.9 → 390.2
storybook incremental 0.785 → 0.789 9,132,465,829 → 9,132,191,436 0.240 → 0.238 368.6 → 367.3
nuxt check 0.811 → 0.813 8,428,829,345.5 → 8,429,097,066 0.210 → 0.211 384.3 → 386.7
nuxt incremental 0.861 → 0.861 8,824,829,641.5 → 8,824,902,325.5 0.230 → 0.235 384.6 → 384.6
playwright check 0.668 → 0.660 7,363,183,418.5 → 7,363,154,819.5 0.180 → 0.177 358.2 → 359.3
playwright incremental 0.697 → 0.699 7,539,385,492.5 → 7,539,497,743 0.196 → 0.197 336.7 → 336.9
drizzle-orm check 0.523 → 0.522 5,907,108,640.5 → 5,907,015,591 0.170 → 0.179 373.3 → 377.8
drizzle-orm incremental 0.520 → 0.522 6,075,910,834 → 6,075,965,964.5 0.174 → 0.173 338.9 → 339.4
typeorm check 0.597 → 0.591 6,344,275,261.5 → 6,344,380,082 0.134 → 0.133 224.1 → 225.0
typeorm incremental 0.639 → 0.640 6,728,627,297.5 → 6,728,559,362.5 0.176 → 0.171 229.3 → 230.3
date-fns check 0.272 → 0.272 3,297,591,284.5 → 3,297,312,142 0.081 → 0.080 150.8 → 150.8
date-fns incremental 0.303 → 0.307 3,530,425,123 → 3,531,012,225.5 0.101 → 0.099 160.5 → 161.2
opencode-core check 2.080 → 2.077 25,106,193,077.5 → 25,108,909,730.5 1.036 → 1.039 1182.6 → 1181.7
opencode-core incremental 2.126 → 2.122 25,468,061,601 → 25,468,149,002 1.070 → 1.070 1089.8 → 1090.6
lobehub check 16.728 → 16.692 185,347,290,170 → 185,331,611,022.5 5.642 → 5.633 4377.1 → 4382.4
lobehub incremental 16.816 → 16.814 188,902,636,855.5 → 188,895,282,803.5 6.884 → 6.879 4429.9 → 4430.4
sentry check 7.667 → 7.653 91,312,215,220 → 91,308,991,411.5 1.689 → 1.679 1750.6 → 1752.1
sentry incremental 7.989 → 7.989 93,270,404,932.5 → 93,273,261,361.5 2.113 → 2.085 1894.7 → 1896.2

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 +1.0% +0.7% -0.1% 35405, identical
webpack TSRS_FAST=1 -1.4% 0.0% 0.0% 35405, identical
drizzle-orm default -0.9% +0.1% -0.1% 7057, identical
drizzle-orm TSRS_FAST=1 -1.3% -0.1% +0.2% 7057, identical
xstate-main default +0.2% -0.1% -0.4% 6489, identical
xstate-main TSRS_FAST=1 +1.1% +0.4% 0.0% 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.350 → 0.352 1.815 → 1.826 455.1 → 454.7
webpack TSRS_FAST=1 0.357 → 0.353 1.821 → 1.827 454.2 → 454.4
drizzle-orm default 0.220 → 0.221 1.182 → 1.191 393.2 → 392.7
drizzle-orm TSRS_FAST=1 0.221 → 0.218 1.176 → 1.174 392.6 → 393.3
xstate-main default 0.312 → 0.312 1.383 → 1.368 337.6 → 336.3
xstate-main TSRS_FAST=1 0.313 → 0.316 1.377 → 1.384 336.0 → 335.9

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