Skip to content

fix(lint/consistent-return): skip parentheses when checking for undefined - #1187

Merged
camc314 merged 1 commit into
fix/lint-consistent-return-1442from
fix/lint-consistent-return-1443
Dec 1, 2026
Merged

camc314 merged 1 commit into
fix/lint-consistent-return-1442from
fix/lint-consistent-return-1443

Conversation

@camc314

@camc314 camc314 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1443 (80b67507), including its baseline update.

With treatUndefinedAsUnspecified, a parenthesized undefined counted as a value return when undefined was a local binding whose type wasn't undefined. The core rule only checks the name undefined, and like typescript-eslint, which drops the parentheses, the rule now skips them before that check.

// treatUndefinedAsUnspecified: true
function f(b: boolean, undefined: number) {
  if (b) return;
  return (undefined); // no longer reported
}

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

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-30T23:19:47.166416Z 66b0a7a 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:32
@camc314
camc314 force-pushed the fix/lint-consistent-return-1443 branch 2 times, most recently from fe825a4 to 7578dff 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 ddba872ad3e1 → PR merge 7f7346be152f (head 66b0a7a7891a)

Clef gate: Clef estimated 13.5% default and single-threaded wall time, 9.4% peak RSS, 10.1% 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 -4.7% -0.001% -3.5% -0.1%
vscode incremental +1.2% +0.001% +1.3% -0.1%
xstate-main check +4.1% +0.001% +1.3% +0.6%
xstate-main incremental +0.9% -0.001% -4.2% -0.2%
webpack check -1.9% -0.002% -2.1% +0.4%
webpack incremental +0.2% 0.000% -0.8% -0.2%
mui-docs check +0.4% +0.004% -2.0% +0.5%
mui-docs incremental -0.2% -0.002% -0.1% +0.1%
Compiler check -4.6% 0.000% -0.1% +0.1%
Compiler incremental -4.8% 0.000% +1.0% +1.6%
Compiler-Unions check -1.5% 0.000% +1.7% -0.6%
Compiler-Unions incremental +2.4% 0.000% -0.7% 0.0%
cal-diy check -0.5% -0.002% -3.4% -0.3%
cal-diy incremental -1.1% -0.001% +0.6% +0.1%
formbricks-web check -2.9% -0.001% -0.3% -0.2%
formbricks-web incremental -2.7% -0.001% -1.1% -0.1%
supabase-studio check -1.1% -0.001% 0.0% -0.1%
supabase-studio incremental +1.7% +0.001% +2.6% -0.2%
t3code-server check +0.7% +0.002% +2.3% 0.0%
t3code-server incremental +0.1% -0.002% -1.0% 0.0%
mikro-orm check 0.0% 0.000% +0.7% +0.4%
mikro-orm incremental +0.3% -0.002% -4.3% 0.0%
next-packages-next check +0.6% -0.001% -1.4% 0.0%
next-packages-next incremental 0.0% 0.000% +0.7% -0.1%
next-root check -1.3% 0.000% -1.6% -0.1%
next-root incremental -3.5% +0.001% -1.1% -0.2%
storybook check -1.0% +0.001% +2.8% -0.3%
storybook incremental +0.6% 0.000% +0.8% +0.2%
nuxt check 0.0% -0.001% -0.1% -0.2%
nuxt incremental +3.0% +0.001% -0.4% +0.4%
playwright check +0.4% -0.002% -1.5% -0.4%
playwright incremental 0.0% -0.001% -1.4% -0.1%
drizzle-orm check -0.5% -0.002% -5.2% -0.4%
drizzle-orm incremental +7.5% -0.002% +1.2% -0.3%
typeorm check +0.5% -0.002% -0.5% -0.2%
typeorm incremental +1.6% +0.002% -4.5% -0.4%
date-fns check -1.2% +0.009% -4.8% 0.0%
date-fns incremental -1.0% -0.003% +3.1% +0.1%
opencode-core check -6.1% -0.002% +5.3% -0.2%
opencode-core incremental +0.2% -0.002% +0.6% -0.3%
lobehub check +6.2% 0.000% +0.4% +0.1%
lobehub incremental +2.1% -0.008% +1.0% 0.0%
sentry check 0.0% +0.003% +0.1% -0.1%
sentry incremental +1.5% -0.002% 0.0% -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 15.206 → 14.795 81,816,992,326.5 → 81,816,532,268 2.269 → 2.215 1806.2 → 1803.7
vscode incremental 9.875 → 10.072 84,217,710,811.5 → 84,218,613,179 3.287 → 3.394 2127.4 → 2125.0
xstate-main check 0.677 → 0.668 5,520,519,146.5 → 5,520,563,719 0.152 → 0.157 239.7 → 241.1
xstate-main incremental 0.659 → 0.680 5,679,497,492 → 5,679,409,617 0.184 → 0.182 241.1 → 240.6
webpack check 1.309 → 1.295 10,760,035,827 → 10,759,826,553 0.256 → 0.253 399.4 → 401.1
webpack incremental 1.031 → 1.051 10,980,102,449 → 10,980,347,551.5 0.255 → 0.252 399.8 → 399.0
mui-docs check 2.404 → 2.394 32,890,021,582.5 → 32,890,527,603.5 0.977 → 0.984 1178.5 → 1184.8
mui-docs incremental 2.790 → 2.815 34,222,186,540 → 34,223,467,426.5 1.859 → 2.000 1140.0 → 1141.3
Compiler check 0.187 → 0.174 1,745,213,475.5 → 1,745,219,141 0.080 → 0.082 77.1 → 77.2
Compiler incremental 0.178 → 0.181 1,759,521,715.5 → 1,759,521,627 0.081 → 0.084 78.1 → 79.3
Compiler-Unions check 0.214 → 0.210 3,014,349,092 → 3,014,341,392 0.096 → 0.098 80.7 → 80.3
Compiler-Unions incremental 0.233 → 0.243 3,026,976,834.5 → 3,026,964,580 0.103 → 0.103 83.7 → 83.7
cal-diy check 2.706 → 2.625 28,707,991,429.5 → 28,707,244,388 0.843 → 0.816 1340.3 → 1336.2
cal-diy incremental 4.145 → 4.021 30,307,383,267.5 → 30,306,990,951.5 1.338 → 1.366 1246.3 → 1247.2
formbricks-web check 3.818 → 3.660 36,892,311,599 → 36,892,066,471.5 0.985 → 0.999 1561.0 → 1557.7
formbricks-web incremental 5.810 → 5.499 39,474,305,176.5 → 39,474,015,096 1.183 → 1.202 1602.3 → 1600.5
supabase-studio check 4.254 → 4.236 40,541,168,486.5 → 40,540,821,686 1.023 → 1.025 1287.8 → 1286.6
supabase-studio incremental 6.735 → 6.165 43,470,692,213 → 43,470,922,540 1.893 → 1.929 1344.8 → 1342.4
t3code-server check 4.042 → 4.094 40,781,377,331.5 → 40,782,025,015.5 1.256 → 1.268 1299.2 → 1299.6
t3code-server incremental 3.647 → 3.634 41,291,222,349 → 41,290,584,417.5 1.427 → 1.425 1294.0 → 1294.2
mikro-orm check 4.685 → 4.609 44,047,875,936 → 44,047,341,424 0.855 → 0.856 1255.2 → 1259.7
mikro-orm incremental 4.016 → 4.102 44,356,872,840 → 44,356,301,532.5 1.658 → 1.590 1237.0 → 1236.6
next-packages-next check 1.641 → 1.642 17,278,164,393 → 17,277,831,327.5 0.412 → 0.416 552.6 → 552.5
next-packages-next incremental 1.526 → 1.522 17,588,820,154.5 → 17,589,135,889 0.446 → 0.452 555.7 → 555.4
next-root check 1.408 → 1.391 13,893,340,810 → 13,893,318,154 0.291 → 0.288 427.6 → 427.1
next-root incremental 1.503 → 1.494 14,350,057,683 → 14,350,304,656.5 0.376 → 0.372 468.1 → 467.2
storybook check 0.803 → 0.804 8,812,851,440.5 → 8,812,921,994.5 0.196 → 0.200 390.3 → 389.1
storybook incremental 0.942 → 0.948 9,132,085,385.5 → 9,132,161,639.5 0.277 → 0.283 367.4 → 368.1
nuxt check 0.826 → 0.826 8,428,938,362.5 → 8,428,991,326.5 0.215 → 0.211 384.8 → 384.0
nuxt incremental 0.963 → 1.028 8,824,800,600 → 8,824,951,559 0.237 → 0.235 383.3 → 385.0
playwright check 0.694 → 0.694 7,363,173,509.5 → 7,362,996,489 0.181 → 0.175 361.1 → 359.7
playwright incremental 0.682 → 0.684 7,539,512,547.5 → 7,539,464,433 0.189 → 0.187 338.5 → 338.1
drizzle-orm check 0.515 → 0.512 5,907,332,145.5 → 5,907,162,115.5 0.172 → 0.170 376.9 → 375.3
drizzle-orm incremental 0.663 → 0.840 6,076,026,501.5 → 6,075,912,995.5 0.208 → 0.208 341.4 → 340.5
typeorm check 0.588 → 0.600 6,344,345,134 → 6,344,248,817.5 0.135 → 0.133 224.7 → 224.1
typeorm incremental 0.759 → 0.779 6,728,529,106.5 → 6,728,563,878 0.184 → 0.179 230.4 → 229.4
date-fns check 0.373 → 0.376 3,297,238,273 → 3,297,536,428 0.109 → 0.103 150.4 → 150.4
date-fns incremental 0.356 → 0.348 3,530,779,014 → 3,530,756,694.5 0.107 → 0.110 161.3 → 161.5
opencode-core check 4.430 → 4.256 25,108,114,323.5 → 25,107,379,123.5 1.988 → 2.119 1185.5 → 1183.0
opencode-core incremental 2.625 → 2.528 25,468,914,062 → 25,468,380,960.5 1.733 → 1.831 1090.9 → 1088.1
lobehub check 18.682 → 19.605 185,337,616,381.5 → 185,332,008,367.5 5.736 → 5.773 4377.7 → 4383.2
lobehub incremental 22.156 → 22.165 188,899,904,467.5 → 188,897,916,650.5 9.027 → 9.203 4431.6 → 4431.5
sentry check 7.784 → 7.794 91,310,480,379 → 91,311,832,755.5 1.745 → 1.728 1750.8 → 1749.7
sentry incremental 9.832 → 9.800 93,269,496,965.5 → 93,268,916,307 2.117 → 2.087 1896.2 → 1894.3

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.8% -0.7% 0.0% 35405, identical
webpack TSRS_FAST=1 -1.8% +1.3% +0.1% 35405, identical
drizzle-orm default +0.5% -1.9% 0.0% 7087, identical
drizzle-orm TSRS_FAST=1 +2.1% +3.2% 0.0% 7087, identical
xstate-main default -2.3% -1.1% 0.0% 6489, identical
xstate-main TSRS_FAST=1 +4.8% +3.1% -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 1.045 → 1.053 4.798 → 4.695 454.5 → 454.5
webpack TSRS_FAST=1 1.013 → 0.994 4.632 → 4.582 453.9 → 454.3
drizzle-orm default 0.607 → 0.590 2.920 → 2.842 392.7 → 392.7
drizzle-orm TSRS_FAST=1 0.563 → 0.617 2.788 → 2.878 393.1 → 393.2
xstate-main default 0.822 → 0.804 3.377 → 3.355 334.6 → 334.7
xstate-main TSRS_FAST=1 0.804 → 0.812 3.348 → 3.466 336.0 → 335.8

@camc314
camc314 force-pushed the fix/lint-consistent-return-1443 branch from 7578dff to 8566db3 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

âś… 6 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing fix/lint-consistent-return-1443 (66b0a7a) with fix/lint-consistent-return-1442 (ddba872)

Open in CodSpeed

Footnotes

  1. 10 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-consistent-return-1443 branch from 8566db3 to 748a3d3 Compare November 30, 2026 22:22
@camc314
camc314 force-pushed the fix/lint-consistent-return-1443 branch from 748a3d3 to 66b0a7a Compare November 30, 2026 23:18
@camc314
camc314 added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 1d4be90 Dec 1, 2026
75 of 77 checks passed
@camc314
camc314 deleted the fix/lint-consistent-return-1443 branch December 1, 2026 09:20
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