Skip to content

fix(lint): visit destructuring default targets as patterns - #1175

Merged
camc314 merged 1 commit into
fix/lint-prefer-optional-chain-1418from
fix/lint-1428
Nov 30, 2026
Merged

camc314 merged 1 commit into
fix/lint-prefer-optional-chain-1418from
fix/lint-1428

Conversation

@camc314

@camc314 camc314 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint#1428 (bac05fd1), including its baseline update.

In a destructuring assignment, the target of a default value was visited as an expression instead of a pattern, so rules that only check array or object expressions also checked targets such as [a] in [[a] = [b]] = c. Like typescript-eslint, which parses this as an AssignmentPattern, an = assignment inside a pattern now visits its left side as a pattern in visit_lint_nodes, as a top-level assignment already did.

let tail: any[];
const src: [number[]?] = [];
[[...tail] = []] = src; // no-unsafe-assignment no longer reports `...tail`

Two unbound_method regression cases with nested destructuring defaults, such as ({ nested: { m: a } = new C() } = {}), now report the method reference. The no-unsafe-assignment baseline was last exported at 6b043c5f, so the refresh also picks up the oxc-project/tsgolint#1396 cases.

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:14:13.849368Z c69c076 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-1428 branch 2 times, most recently from d727a39 to 0111b1a Compare November 30, 2026 17:04
@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-1428 (c69c076) with fix/lint-prefer-optional-chain-1418 (4bc5aa8)

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
@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main 4bc5aa8a1318 β†’ PR merge a07c8db86bbd (head c69c0762e4cc)

Clef gate: Clef estimated 27.3% default and single-threaded wall time, 17.6% peak RSS, 21.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 -1.7% +0.001% +1.5% +0.2%
vscode incremental +7.0% 0.000% +1.9% +0.3%
xstate-main check -0.6% +0.001% -3.6% -0.3%
xstate-main incremental -2.4% -0.002% -4.5% +0.2%
webpack check -1.8% +0.001% -0.5% +0.6%
webpack incremental +2.8% 0.000% +0.8% -0.6%
mui-docs check -4.8% +0.003% -10.2% -2.2%
mui-docs incremental -1.1% +0.005% +2.4% +0.1%
Compiler check -6.0% 0.000% +11.1% -1.9%
Compiler incremental +1.4% 0.000% +7.6% 0.0%
Compiler-Unions check -3.5% 0.000% +6.0% +0.9%
Compiler-Unions incremental -0.3% 0.000% +0.9% -0.4%
cal-diy check -5.4% -0.001% -1.1% -0.2%
cal-diy incremental -0.4% 0.000% +0.1% 0.0%
formbricks-web check +1.0% +0.001% -1.6% 0.0%
formbricks-web incremental +3.6% -0.002% 0.0% -0.2%
supabase-studio check +3.2% -0.002% -1.2% +0.6%
supabase-studio incremental +0.4% -0.003% +1.4% -0.1%
t3code-server check +0.4% -0.003% +2.7% 0.0%
t3code-server incremental +4.6% -0.008% +1.5% +0.1%
mikro-orm check -0.7% 0.000% -0.7% -0.5%
mikro-orm incremental -0.7% -0.001% 0.0% 0.0%
next-packages-next check 0.0% +0.001% +0.1% -0.2%
next-packages-next incremental -1.3% +0.002% -7.9% -0.2%
next-root check +1.1% +0.002% +2.6% -0.2%
next-root incremental +5.0% 0.000% +1.3% -0.2%
storybook check +2.9% +0.002% +4.6% -0.3%
storybook incremental +0.2% +0.005% +1.8% -0.6%
nuxt check +3.3% +0.003% -9.6% 0.0%
nuxt incremental +1.1% -0.001% -0.1% -0.4%
playwright check +3.9% +0.001% -3.9% +0.2%
playwright incremental +8.5% -0.001% +5.6% +0.3%
drizzle-orm check -0.5% +0.002% +0.4% -1.2%
drizzle-orm incremental -3.7% -0.002% -1.7% -0.3%
typeorm check +1.9% 0.000% +0.9% +0.9%
typeorm incremental +0.1% +0.001% +0.7% -0.8%
date-fns check -2.1% -0.007% -3.1% 0.0%
date-fns incremental -2.3% +0.002% +5.3% +0.1%
opencode-core check +3.4% +0.002% -2.9% 0.0%
opencode-core incremental -2.2% -0.002% +10.0% 0.0%
lobehub check -0.9% +0.001% +2.0% -0.2%
lobehub incremental -2.2% +0.004% +6.9% +0.1%
sentry check failed β€” β€” β€”
sentry incremental -4.2% 0.000% -0.5% -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.
Measurements missing or invalid on: sentry (check). See the workflow run for errors.

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.500 β†’ 10.815 81,815,566,516.5 β†’ 81,816,251,129.5 1.538 β†’ 1.559 1800.6 β†’ 1804.3
vscode incremental 15.461 β†’ 16.008 84,217,464,743.5 β†’ 84,217,440,993 3.176 β†’ 3.440 2123.6 β†’ 2129.4
xstate-main check 0.679 β†’ 0.687 5,520,540,423 β†’ 5,520,543,168.5 0.163 β†’ 0.157 240.1 β†’ 239.3
xstate-main incremental 0.621 β†’ 0.614 5,679,457,632 β†’ 5,679,367,509 0.192 β†’ 0.185 241.4 β†’ 241.8
webpack check 1.604 β†’ 1.679 10,760,397,373.5 β†’ 10,760,529,534 0.367 β†’ 0.359 399.9 β†’ 402.2
webpack incremental 1.553 β†’ 1.604 10,980,220,719.5 β†’ 10,980,358,961 0.405 β†’ 0.405 400.7 β†’ 398.4
mui-docs check 3.972 β†’ 3.844 32,889,872,771 β†’ 32,890,998,120.5 1.504 β†’ 1.434 1208.1 β†’ 1181.3
mui-docs incremental 4.216 β†’ 4.159 34,222,436,297 β†’ 34,223,192,628 1.654 β†’ 1.675 1140.1 β†’ 1141.1
Compiler check 0.282 β†’ 0.252 1,745,220,684 β†’ 1,745,207,551 0.130 β†’ 0.137 77.3 β†’ 75.9
Compiler incremental 0.245 β†’ 0.244 1,759,510,099 β†’ 1,759,508,421.5 0.106 β†’ 0.119 78.4 β†’ 78.4
Compiler-Unions check 0.354 β†’ 0.343 3,014,346,366 β†’ 3,014,338,045.5 0.148 β†’ 0.151 79.9 β†’ 80.7
Compiler-Unions incremental 0.266 β†’ 0.263 3,026,969,574.5 β†’ 3,026,958,865.5 0.123 β†’ 0.123 83.8 β†’ 83.5
cal-diy check 3.697 β†’ 3.486 28,707,732,195 β†’ 28,707,682,580.5 0.891 β†’ 0.867 1342.3 β†’ 1339.5
cal-diy incremental 3.936 β†’ 3.901 30,308,167,473 β†’ 30,308,261,614.5 1.254 β†’ 1.248 1246.7 β†’ 1247.1
formbricks-web check 4.276 β†’ 4.322 36,891,945,687.5 β†’ 36,892,554,469 0.917 β†’ 0.917 1560.1 β†’ 1560.7
formbricks-web incremental 4.512 β†’ 4.611 39,475,103,091.5 β†’ 39,474,538,241 1.158 β†’ 1.171 1601.5 β†’ 1598.7
supabase-studio check 6.679 β†’ 7.012 40,539,513,513.5 β†’ 40,539,436,165.5 1.577 β†’ 1.567 1278.3 β†’ 1285.8
supabase-studio incremental 6.662 β†’ 6.622 43,471,036,185 β†’ 43,469,859,453.5 1.680 β†’ 1.726 1344.0 β†’ 1342.7
t3code-server check 6.217 β†’ 6.495 40,782,946,965 β†’ 40,781,398,559 1.898 β†’ 1.827 1297.0 β†’ 1297.5
t3code-server incremental 7.024 β†’ 6.906 41,292,788,401.5 β†’ 41,289,899,978 3.121 β†’ 3.158 1289.3 β†’ 1290.0
mikro-orm check 5.990 β†’ 5.135 44,046,872,057.5 β†’ 44,047,070,280 0.991 β†’ 0.979 1260.6 β†’ 1254.8
mikro-orm incremental 4.433 β†’ 4.338 44,356,747,810 β†’ 44,355,489,910.5 1.036 β†’ 1.029 1237.4 β†’ 1237.7
next-packages-next check 1.610 β†’ 1.569 17,277,992,708.5 β†’ 17,278,140,051 0.374 β†’ 0.372 552.2 β†’ 550.8
next-packages-next incremental 2.568 β†’ 2.623 17,588,760,932.5 β†’ 17,589,115,562.5 0.703 β†’ 0.688 555.9 β†’ 555.0
next-root check 2.130 β†’ 2.095 13,893,437,603 β†’ 13,893,810,833.5 0.438 β†’ 0.452 425.1 β†’ 424.3
next-root incremental 1.755 β†’ 1.964 14,350,195,052 β†’ 14,350,088,044.5 0.545 β†’ 0.541 467.6 β†’ 466.6
storybook check 1.455 β†’ 1.555 8,812,971,160 β†’ 8,813,131,064.5 0.307 β†’ 0.321 392.7 β†’ 391.7
storybook incremental 1.235 β†’ 1.232 9,132,788,681.5 β†’ 9,133,253,766.5 0.355 β†’ 0.365 369.8 β†’ 367.4
nuxt check 1.558 β†’ 1.523 8,428,732,048 β†’ 8,429,028,707 0.424 β†’ 0.392 384.4 β†’ 384.2
nuxt incremental 1.366 β†’ 1.365 8,824,842,619 β†’ 8,824,890,717 0.356 β†’ 0.373 385.1 β†’ 383.8
playwright check 0.928 β†’ 0.937 7,362,900,362 β†’ 7,363,170,707 0.191 β†’ 0.184 358.7 β†’ 359.5
playwright incremental 0.964 β†’ 0.993 7,539,491,454.5 β†’ 7,539,426,939.5 0.380 β†’ 0.386 336.7 β†’ 337.5
drizzle-orm check 0.846 β†’ 0.818 5,907,083,857 β†’ 5,907,659,643 0.292 β†’ 0.287 379.4 β†’ 374.7
drizzle-orm incremental 0.937 β†’ 0.888 6,076,002,832 β†’ 6,075,890,178 0.280 β†’ 0.279 340.0 β†’ 339.0
typeorm check 0.850 β†’ 0.858 6,344,334,180 β†’ 6,344,318,577.5 0.194 β†’ 0.197 223.2 β†’ 225.1
typeorm incremental 1.042 β†’ 1.032 6,728,549,338.5 β†’ 6,728,725,171.5 0.288 β†’ 0.293 230.7 β†’ 229.0
date-fns check 0.339 β†’ 0.340 3,297,393,716 β†’ 3,297,152,218 0.094 β†’ 0.091 150.6 β†’ 150.6
date-fns incremental 0.403 β†’ 0.403 3,530,309,643.5 β†’ 3,530,640,268 0.127 β†’ 0.135 161.5 β†’ 161.5
opencode-core check 3.400 β†’ 3.513 25,109,009,796.5 β†’ 25,108,428,476 1.989 β†’ 1.901 1180.7 β†’ 1180.8
opencode-core incremental 3.146 β†’ 3.191 25,468,293,564.5 β†’ 25,468,463,557.5 1.533 β†’ 1.613 1088.7 β†’ 1088.8
lobehub check 23.664 β†’ 24.200 185,343,796,644.5 β†’ 185,352,634,102 7.810 β†’ 7.998 4389.5 β†’ 4379.1
lobehub incremental 21.374 β†’ 22.760 188,897,186,076 β†’ 188,894,691,289.5 8.891 β†’ 9.446 4430.3 β†’ 4433.8
sentry incremental 14.013 β†’ 14.169 93,272,417,265 β†’ 93,274,084,967.5 3.235 β†’ 3.241 1897.1 β†’ 1895.7

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.1% -1.6% 0.0% 35405, identical
webpack TSRS_FAST=1 -3.0% -5.1% -0.1% 35405, identical
drizzle-orm default -2.9% -3.7% -0.3% 7055, identical
drizzle-orm TSRS_FAST=1 -1.0% -1.4% -0.1% 7055, identical
xstate-main default +2.6% +2.5% -1.4% 6489, identical
xstate-main TSRS_FAST=1 -3.7% -4.0% +0.3% 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.903 β†’ 0.970 4.603 β†’ 4.536 454.8 β†’ 454.6
webpack TSRS_FAST=1 0.986 β†’ 0.933 4.639 β†’ 4.572 454.6 β†’ 454.3
drizzle-orm default 0.635 β†’ 0.609 2.982 β†’ 2.939 393.4 β†’ 392.2
drizzle-orm TSRS_FAST=1 0.621 β†’ 0.612 3.011 β†’ 2.983 392.8 β†’ 392.3
xstate-main default 0.899 β†’ 0.887 3.661 β†’ 3.704 335.4 β†’ 330.6
xstate-main TSRS_FAST=1 0.883 β†’ 0.786 3.648 β†’ 3.462 332.9 β†’ 334.0

Merged via the queue into main with commit 42ecbf9 Nov 30, 2026
76 of 77 checks passed
@camc314
camc314 deleted the fix/lint-1428 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