Skip to content

fix(lint/unbound-method): treat nullish coalescing like other logical operators - #1177

Merged
camc314 merged 1 commit into
fix/lint-1429from
fix/lint-unbound-method-1425
Nov 30, 2026
Merged

camc314 merged 1 commit into
fix/lint-1429from
fix/lint-unbound-method-1425

Conversation

@camc314

@camc314 camc314 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1425 (bb35b134), including its baseline update.

is_safe_use walked up through && and || but stopped at ??, so a method reference on the left of ?? was always reported. Like typescript-eslint, which parses ?? as a LogicalExpression, it now keeps walking up through ??, so a reference that is only tested for truthiness is safe. A reference that escapes through ??, such as const f = x.m ?? fallback, is still reported.

function f(x: { m?(): void }) {
  if (x.m ?? false) { // no longer reported
  }
}

The unbound_method regression fixtures no longer expect the two ?? reports in safe_wrappers.ts.

Copilot AI balanced review requested due to automatic review settings November 30, 2026 14:06

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 30, 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-30T18:13:43.768555Z 5bcf726 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 added this pull request to stack #1163 November 30, 2026 14:06
@camc314
camc314 force-pushed the fix/lint-unbound-method-1425 branch 2 times, most recently from 018f827 to 7ff44b0 Compare November 30, 2026 17:04
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main f7e586048a29 → PR merge 8141ffd65e94 (head 5bcf7261c1cf)

Clef gate: Clef estimated 12.9% default and single-threaded wall time, 8.7% peak RSS, 12.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 -1.9% -0.001% -0.4% +0.1%
vscode incremental +1.1% 0.000% +1.6% -0.1%
xstate-main check -0.9% +0.001% +0.6% -0.8%
xstate-main incremental +5.9% 0.000% -0.4% -0.1%
webpack check +1.4% -0.001% -8.7% +0.5%
webpack incremental +0.2% -0.001% -0.4% -0.1%
mui-docs check -2.4% 0.000% -1.3% -0.8%
mui-docs incremental 0.0% -0.003% +0.5% 0.0%
Compiler check -2.4% +0.001% -4.2% -0.2%
Compiler incremental -0.5% 0.000% +3.9% 0.0%
Compiler-Unions check -4.9% 0.000% -1.4% +0.4%
Compiler-Unions incremental +0.2% 0.000% -2.7% -0.4%
cal-diy check +1.5% +0.001% -0.3% +0.3%
cal-diy incremental -1.5% -0.003% +0.5% +0.2%
formbricks-web check +0.6% -0.001% -0.6% +0.1%
formbricks-web incremental -5.5% 0.000% +0.6% +0.1%
supabase-studio check -0.9% +0.004% +4.6% -0.2%
supabase-studio incremental +0.3% -0.006% +0.6% +0.1%
t3code-server check -1.1% -0.002% -4.3% -0.2%
t3code-server incremental +3.0% -0.002% +0.7% -0.2%
mikro-orm check -0.6% +0.001% -1.5% -0.4%
mikro-orm incremental -0.2% +0.001% -0.5% -0.4%
next-packages-next check +1.6% 0.000% +2.9% 0.0%
next-packages-next incremental -0.6% 0.000% +0.2% 0.0%
next-root check -0.9% -0.002% +1.6% +0.3%
next-root incremental +2.1% 0.000% +6.9% 0.0%
storybook check -2.5% -0.001% +2.0% +0.6%
storybook incremental +0.3% +0.014% -2.6% 0.0%
nuxt check +0.9% +0.001% +0.6% -0.1%
nuxt incremental -5.5% -0.004% +1.2% 0.0%
playwright check -0.2% -0.001% -1.9% +1.1%
playwright incremental -7.3% -0.001% -4.5% +0.5%
drizzle-orm check -2.9% -0.001% -0.5% +0.2%
drizzle-orm incremental +1.9% -0.001% -2.4% 0.0%
typeorm check -5.5% 0.000% +3.2% -0.4%
typeorm incremental +0.4% +0.001% +3.1% +0.7%
date-fns check -1.4% +0.005% +2.0% -0.4%
date-fns incremental -1.6% +0.003% +1.4% -0.3%
opencode-core check -2.1% -0.003% +5.0% +0.1%
opencode-core incremental -0.3% -0.001% -0.3% -0.1%
lobehub check -1.0% -0.002% +2.5% -0.1%
lobehub incremental +2.4% -0.010% -5.8% +0.1%
sentry check +0.7% -0.001% +1.4% -0.2%
sentry incremental -2.1% -0.001% -1.3% 0.0%

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 12.013 → 12.040 81,816,090,297.5 → 81,815,571,833.5 1.656 → 1.662 1804.5 → 1805.9
vscode incremental 12.390 → 12.115 84,217,111,468.5 → 84,217,666,838 2.325 → 2.362 2127.4 → 2124.4
xstate-main check 0.676 → 0.665 5,520,514,712 → 5,520,555,381 0.168 → 0.166 241.2 → 239.2
xstate-main incremental 0.780 → 0.826 5,679,401,187 → 5,679,403,948 0.258 → 0.252 242.0 → 241.8
webpack check 2.633 → 2.714 10,759,815,745 → 10,759,705,319 0.660 → 0.606 399.6 → 401.7
webpack incremental 1.523 → 1.502 10,980,505,686.5 → 10,980,290,762 0.375 → 0.377 398.8 → 398.5
mui-docs check 5.766 → 5.272 32,890,175,853.5 → 32,889,462,655 1.902 → 2.130 1192.4 → 1182.6
mui-docs incremental 3.543 → 3.446 34,223,934,007 → 34,222,648,167.5 1.490 → 1.462 1140.4 → 1140.2
Compiler check 0.228 → 0.230 1,745,217,539 → 1,745,224,503 0.108 → 0.104 77.4 → 77.3
Compiler incremental 0.242 → 0.245 1,759,519,892.5 → 1,759,516,374 0.101 → 0.105 78.5 → 78.5
Compiler-Unions check 0.377 → 0.367 3,014,351,179 → 3,014,339,392.5 0.190 → 0.181 79.9 → 80.2
Compiler-Unions incremental 0.276 → 0.279 3,026,966,883.5 → 3,026,967,037.5 0.129 → 0.125 83.8 → 83.4
cal-diy check 3.769 → 3.767 28,706,809,042 → 28,706,904,251 1.100 → 1.095 1328.3 → 1332.7
cal-diy incremental 3.853 → 3.798 30,307,840,972 → 30,307,195,471 1.343 → 1.337 1245.2 → 1248.0
formbricks-web check 4.703 → 4.709 36,892,094,947 → 36,891,977,323.5 1.090 → 1.089 1557.7 → 1558.7
formbricks-web incremental 5.149 → 5.127 39,475,180,568.5 → 39,476,025,900 1.450 → 1.449 1599.1 → 1599.9
supabase-studio check 7.304 → 7.455 40,539,470,010 → 40,541,740,696 1.458 → 1.467 1286.6 → 1284.6
supabase-studio incremental 9.492 → 10.195 43,472,277,789 → 43,470,369,319 2.551 → 2.551 1341.1 → 1342.1
t3code-server check 5.989 → 5.814 40,782,094,093.5 → 40,781,469,734 2.014 → 1.940 1296.2 → 1293.2
t3code-server incremental 5.205 → 5.165 41,290,602,767.5 → 41,291,261,345.5 2.039 → 2.067 1296.0 → 1292.8
mikro-orm check 5.658 → 5.596 44,047,425,021 → 44,047,343,096.5 1.101 → 1.129 1258.8 → 1253.3
mikro-orm incremental 8.784 → 8.748 44,356,002,665 → 44,356,214,776.5 2.521 → 2.439 1238.3 → 1233.8
next-packages-next check 2.251 → 2.273 17,277,931,096.5 → 17,277,940,940.5 0.628 → 0.639 550.8 → 550.5
next-packages-next incremental 2.134 → 2.112 17,589,017,261 → 17,589,256,171.5 0.801 → 0.810 555.1 → 555.4
next-root check 1.800 → 1.776 13,893,694,258 → 13,893,333,445 0.380 → 0.377 428.2 → 429.3
next-root incremental 3.492 → 3.673 14,350,021,261 → 14,350,274,202.5 1.129 → 1.179 468.8 → 468.7
storybook check 1.289 → 1.244 8,812,992,726.5 → 8,812,900,691 0.320 → 0.316 388.9 → 391.5
storybook incremental 1.325 → 1.335 9,132,087,527.5 → 9,134,124,811.5 0.417 → 0.399 368.6 → 368.8
nuxt check 1.191 → 1.218 8,428,721,785 → 8,428,796,241.5 0.330 → 0.338 384.8 → 384.5
nuxt incremental 1.864 → 1.768 8,825,062,902 → 8,824,773,257 0.436 → 0.436 385.2 → 385.1
playwright check 1.420 → 1.421 7,363,089,748.5 → 7,362,991,057.5 0.396 → 0.395 356.5 → 360.2
playwright incremental 1.309 → 1.228 7,539,519,146 → 7,539,415,639 0.381 → 0.370 336.4 → 338.1
drizzle-orm check 0.755 → 0.738 5,907,162,840 → 5,907,088,823 0.255 → 0.256 376.0 → 376.6
drizzle-orm incremental 1.263 → 1.230 6,075,830,026.5 → 6,075,812,390.5 0.508 → 0.496 340.7 → 340.8
typeorm check 1.077 → 1.042 6,344,398,790 → 6,344,301,904.5 0.254 → 0.255 224.2 → 223.3
typeorm incremental 0.935 → 0.936 6,728,538,175.5 → 6,728,586,135 0.244 → 0.256 229.7 → 231.3
date-fns check 0.531 → 0.538 3,297,276,308 → 3,297,372,510.5 0.193 → 0.200 150.6 → 149.9
date-fns incremental 0.394 → 0.393 3,530,911,245 → 3,530,506,494 0.151 → 0.151 161.6 → 161.1
opencode-core check 3.292 → 3.189 25,107,696,250.5 → 25,106,964,367.5 1.916 → 2.020 1179.7 → 1181.2
opencode-core incremental 2.341 → 2.332 25,468,060,391.5 → 25,467,838,907 1.127 → 1.126 1091.7 → 1090.7
lobehub check 27.586 → 25.871 185,340,225,066 → 185,337,639,800 7.880 → 8.590 4385.9 → 4382.0
lobehub incremental 30.384 → 30.719 188,905,913,718 → 188,885,107,666 13.439 → 12.795 4425.6 → 4429.1
sentry check 13.042 → 13.206 91,312,301,046.5 → 91,309,290,389 2.187 → 2.259 1754.1 → 1750.7
sentry incremental 12.896 → 12.320 93,269,289,758.5 → 93,269,998,734.5 3.636 → 3.747 1895.4 → 1895.5

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 +6.8% +5.0% -0.3% 35405, identical
webpack TSRS_FAST=1 -1.4% -0.3% -0.1% 35405, identical
drizzle-orm default +1.3% +1.2% -0.1% 7055, identical
drizzle-orm TSRS_FAST=1 0.0% +0.6% 0.0% 7055, identical
xstate-main default +0.5% +0.4% -0.1% 6489, identical
xstate-main TSRS_FAST=1 +2.1% +2.6% -0.6% 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.540 → 0.570 2.695 → 2.831 454.9 → 453.7
webpack TSRS_FAST=1 0.557 → 0.549 2.738 → 2.744 454.8 → 454.5
drizzle-orm default 0.381 → 0.371 1.942 → 1.874 393.0 → 392.5
drizzle-orm TSRS_FAST=1 0.390 → 0.386 1.939 → 2.000 392.7 → 392.7
xstate-main default 0.507 → 0.503 2.234 → 2.240 334.5 → 334.1
xstate-main TSRS_FAST=1 0.516 → 0.535 2.288 → 2.293 337.5 → 335.4

@camc314
camc314 force-pushed the fix/lint-unbound-method-1425 branch from 7ff44b0 to 5bcf726 Compare November 30, 2026 18:12
@codspeed

codspeed Bot commented Nov 30, 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-unbound-method-1425 (5bcf726) with fix/lint-1429 (f7e5860)

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 added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 6f1c8d4 Nov 30, 2026
77 checks passed
@camc314
camc314 deleted the fix/lint-unbound-method-1425 branch November 30, 2026 22:22
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