Skip to content

feat(lint/no-misused-promises): add flagUnions option for checksConditionals - #988

Merged
camc314 merged 1 commit into
mainfrom
feat/no-misused-promises-flag-unions
Nov 12, 2026
Merged

camc314 merged 1 commit into
mainfrom
feat/no-misused-promises-flag-unions

Conversation

@camc314

@camc314 camc314 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports oxc-project/tsgolint#1353: checksConditionals now accepts either a boolean or { flagUnions?: "none" | "strict" | "all" }, matching typescript-eslint 8.69.0.

declare const value: Promise<number> | number;
if (value) {
}
  • "none" (default) keeps reporting only values that are always thenable.
  • "strict" reports unions such as Promise<T> | T, where the non-Promise members match the Promise's awaited type. It reports the example above.
  • "all" reports any union with a thenable member.

Details

  • Option decoding follows Go:
    • An object with a missing, null, or invalid flagUnions falls back to "none".
    • A non-boolean, non-object checksConditionals now turns the check on. tsrs used to reject it with an error.
    • A headless test covers these fallbacks; its expected results were checked against the upstream linter.
  • The no-misused-promises baseline is re-exported at tsgolint 1ae4bbd5 and gains the 26 upstream flagUnions cases. The rest of the corpus keeps its existing pins.
  • tools/tsgolint/export.mts gains --reference <sha> for one-rule refreshes. It also warns when an exported rule's checked-in REFERENCE is pinned to a different commit, so a full re-export can't silently undo such a refresh.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 17:09

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. Try requesting a review at a lower effort level.

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 12, 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-12T17:11:03.645733Z c78baa3 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 changed the title feat(lint/no-misused-promises): add flagUnions option for checksConditionals feat(lint/no-misused-promises): add flagUnions option for checksConditionals Nov 12, 2026
@camc314
camc314 enabled auto-merge November 12, 2026 17:10
@camc314
camc314 added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit af46b62 Nov 12, 2026
20 checks passed
@camc314
camc314 deleted the feat/no-misused-promises-flag-unions branch November 12, 2026 17:22
@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main b407efb63aaf β†’ PR merge 8e0016357d8b (head c78baa3125f8)

Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/rules/no_misused_promises.rs: patch exceeds the Clef context limit (4792 bytes)).

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.6% 0.000% -0.5% 0.0%
vscode incremental +4.4% 0.000% -1.9% -0.1%
xstate-main check +3.1% +0.002% +1.1% +0.2%
xstate-main incremental -1.7% -0.004% -5.6% -0.3%
webpack check +5.6% +0.004% -0.8% +0.1%
webpack incremental -1.5% +0.007% +0.2% +0.1%
mui-docs check +2.2% +0.007% -1.1% -0.1%
mui-docs incremental +10.8% +0.005% +4.6% -0.2%
Compiler check +1.3% 0.000% +1.7% -0.2%
Compiler incremental +4.7% 0.000% +8.0% -0.1%
Compiler-Unions check +2.3% -0.001% +0.8% -0.4%
Compiler-Unions incremental +0.4% 0.000% -2.4% +0.2%
cal-diy check -0.7% +0.004% -0.8% -0.7%
cal-diy incremental +0.4% -0.001% -2.2% 0.0%
formbricks-web check +0.5% 0.000% -1.6% 0.0%
formbricks-web incremental -5.1% +0.002% +2.1% -0.1%
supabase-studio check -3.4% +0.002% +2.0% -0.2%
supabase-studio incremental +3.0% +0.002% -1.8% +0.1%
t3code-server check -1.9% -0.002% +0.3% +0.1%
t3code-server incremental -2.3% -0.004% -2.1% -0.2%
mikro-orm check -0.1% +0.001% -5.5% -0.4%
mikro-orm incremental +4.6% 0.000% -2.6% 0.0%
next-packages-next check +1.9% -0.001% -1.8% -0.4%
next-packages-next incremental +1.7% 0.000% +0.4% +0.1%
next-root check -0.3% -0.002% +1.6% -0.1%
next-root incremental -2.2% 0.000% +1.0% -0.2%
storybook check +1.2% 0.000% +1.5% +0.2%
storybook incremental +0.6% +0.006% -0.1% +0.2%
nuxt check +1.7% -0.004% -1.5% +0.3%
nuxt incremental -1.1% -0.004% +0.8% +0.1%
playwright check +1.1% +0.001% -2.1% +0.3%
playwright incremental +0.4% +0.002% -1.7% +0.4%
drizzle-orm check -0.2% 0.000% -6.6% -2.3%
drizzle-orm incremental +1.2% +0.004% -3.6% +0.3%
typeorm check +2.9% 0.000% -0.8% +0.3%
typeorm incremental -5.5% 0.000% +5.5% -0.2%
date-fns check -1.3% +0.022% +2.9% -0.7%
date-fns incremental 0.0% +0.009% -1.4% +0.2%

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 10.043 β†’ 9.894 82,406,541,045 β†’ 82,406,704,547 1.693 β†’ 1.687 1843.1 β†’ 1843.2
vscode incremental 12.826 β†’ 13.578 84,821,163,353 β†’ 84,821,255,963 2.914 β†’ 2.876 2163.0 β†’ 2161.4
xstate-main check 0.936 β†’ 0.955 5,570,766,038.5 β†’ 5,570,814,440.5 0.199 β†’ 0.192 241.2 β†’ 241.7
xstate-main incremental 0.739 β†’ 0.735 5,733,679,888 β†’ 5,733,497,049.5 0.299 β†’ 0.292 244.3 β†’ 243.5
webpack check 1.308 β†’ 1.359 10,900,093,112.5 β†’ 10,900,142,117.5 0.260 β†’ 0.252 402.9 β†’ 403.4
webpack incremental 1.125 β†’ 1.089 11,123,253,420 β†’ 11,123,832,416.5 0.283 β†’ 0.286 402.4 β†’ 402.7
mui-docs check 2.996 β†’ 3.461 33,123,566,742 β†’ 33,125,547,296.5 1.177 β†’ 1.130 1236.2 β†’ 1234.7
mui-docs incremental 4.152 β†’ 4.638 34,466,545,444.5 β†’ 34,472,941,690.5 1.979 β†’ 1.924 1161.1 β†’ 1158.3
Compiler check 0.183 β†’ 0.181 1,776,346,443 β†’ 1,776,338,530 0.082 β†’ 0.081 76.0 β†’ 75.8
Compiler incremental 0.204 β†’ 0.211 1,789,148,448.5 β†’ 1,789,154,905 0.092 β†’ 0.098 79.2 β†’ 79.2
Compiler-Unions check 0.294 β†’ 0.296 3,054,468,738 β†’ 3,054,433,042 0.126 β†’ 0.124 80.7 β†’ 80.4
Compiler-Unions incremental 0.253 β†’ 0.250 3,066,293,979.5 β†’ 3,066,295,990 0.124 β†’ 0.123 84.5 β†’ 84.7
cal-diy check 4.403 β†’ 4.385 28,973,477,521.5 β†’ 28,974,377,815.5 1.461 β†’ 1.502 1355.0 β†’ 1345.6
cal-diy incremental 4.892 β†’ 5.005 30,596,925,205 β†’ 30,597,678,197 1.339 β†’ 1.268 1270.1 β†’ 1270.6
formbricks-web check 3.410 β†’ 3.426 37,110,562,282 β†’ 37,110,054,053.5 0.868 β†’ 0.859 1582.6 β†’ 1582.3
formbricks-web incremental 6.798 β†’ 6.684 39,709,172,653.5 β†’ 39,709,711,411 2.851 β†’ 2.788 1625.7 β†’ 1624.8
supabase-studio check 7.269 β†’ 6.363 40,840,620,693 β†’ 40,841,999,776 1.333 β†’ 1.318 1310.9 β†’ 1308.8
supabase-studio incremental 7.401 β†’ 7.549 43,790,947,251.5 β†’ 43,791,433,118.5 2.274 β†’ 2.253 1368.4 β†’ 1369.8
t3code-server check 5.225 β†’ 4.851 41,107,721,764 β†’ 41,108,058,063.5 2.048 β†’ 1.994 1452.8 β†’ 1454.7
t3code-server incremental 4.786 β†’ 4.859 41,630,525,526.5 β†’ 41,631,877,282.5 2.150 β†’ 2.126 1310.6 β†’ 1308.5
mikro-orm check 6.432 β†’ 6.225 44,563,226,698 β†’ 44,563,729,850 1.351 β†’ 1.256 1285.1 β†’ 1280.2
mikro-orm incremental 6.056 β†’ 6.330 44,875,417,672.5 β†’ 44,875,346,315.5 1.548 β†’ 1.503 1258.6 β†’ 1258.8
next-packages-next check 2.099 β†’ 2.256 17,410,414,251.5 β†’ 17,410,287,525 0.517 β†’ 0.513 561.5 β†’ 559.2
next-packages-next incremental 2.031 β†’ 1.964 17,736,391,926.5 β†’ 17,736,106,497 0.519 β†’ 0.526 564.2 β†’ 564.8
next-root check 1.188 β†’ 1.187 13,969,431,136.5 β†’ 13,969,159,383.5 0.258 β†’ 0.260 431.8 β†’ 431.5
next-root incremental 1.458 β†’ 1.439 14,431,254,878.5 β†’ 14,431,129,439 0.375 β†’ 0.377 474.1 β†’ 472.9
storybook check 1.299 β†’ 1.336 8,875,563,007 β†’ 8,875,566,419 0.401 β†’ 0.400 399.6 β†’ 400.4
storybook incremental 1.035 β†’ 1.067 9,200,236,542.5 β†’ 9,200,449,020 0.287 β†’ 0.285 377.0 β†’ 377.8
nuxt check 1.192 β†’ 1.168 8,507,208,759 β†’ 8,506,828,789 0.327 β†’ 0.309 389.4 β†’ 390.7
nuxt incremental 1.386 β†’ 1.352 8,909,331,299.5 β†’ 8,909,263,349 0.432 β†’ 0.433 392.5 β†’ 392.9
playwright check 0.754 β†’ 0.768 7,408,246,158 β†’ 7,408,285,067.5 0.202 β†’ 0.200 361.6 β†’ 362.5
playwright incremental 2.025 β†’ 1.948 7,581,175,892 β†’ 7,581,313,173 0.391 β†’ 0.408 339.2 β†’ 340.6
drizzle-orm check 0.894 β†’ 0.889 5,952,337,663 β†’ 5,952,424,983 0.338 β†’ 0.309 385.1 β†’ 376.3
drizzle-orm incremental 0.766 β†’ 0.774 6,124,067,335.5 β†’ 6,124,190,175 0.250 β†’ 0.248 345.5 β†’ 346.4
typeorm check 1.011 β†’ 1.002 6,400,204,575 β†’ 6,400,127,547.5 0.380 β†’ 0.354 225.0 β†’ 225.5
typeorm incremental 1.485 β†’ 1.363 6,777,453,479 β†’ 6,777,739,495.5 0.366 β†’ 0.383 232.3 β†’ 231.8
date-fns check 0.354 β†’ 0.346 3,357,016,429 β†’ 3,357,782,760.5 0.120 β†’ 0.118 152.1 β†’ 151.1
date-fns incremental 0.340 β†’ 0.338 3,593,830,585 β†’ 3,594,236,137.5 0.171 β†’ 0.172 162.7 β†’ 163.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.5% +0.3% +0.4% 37258, identical
webpack TSRS_FAST=1 -0.5% 0.0% -0.3% 37258, identical
drizzle-orm default +0.2% 0.0% +0.4% 7057, identical
drizzle-orm TSRS_FAST=1 -1.1% -0.7% -0.4% 7057, identical
xstate-main default -0.1% +0.8% +0.3% 6489, identical
xstate-main TSRS_FAST=1 -1.9% -2.2% +0.9% 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.662 β†’ 0.701 2.137 β†’ 2.239 440.0 β†’ 441.6
webpack TSRS_FAST=1 0.488 β†’ 0.470 2.405 β†’ 2.358 467.8 β†’ 466.4
drizzle-orm default 0.425 β†’ 0.426 1.400 β†’ 1.400 440.0 β†’ 441.9
drizzle-orm TSRS_FAST=1 0.257 β†’ 0.254 1.362 β†’ 1.354 404.5 β†’ 403.0
xstate-main default 0.461 β†’ 0.454 1.581 β†’ 1.568 358.7 β†’ 359.7
xstate-main TSRS_FAST=1 0.365 β†’ 0.358 1.659 β†’ 1.588 340.7 β†’ 343.9

@codspeed

codspeed Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

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 feat/no-misused-promises-flag-unions (c78baa3) with main (62ca32b)2

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

  2. No successful run was found on main (b407efb) during the generation of this report, so 62ca32b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

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