Skip to content

fix(lint): report global and declaration diagnostics in the type check - #1056

Merged
camc314 merged 2 commits into
mainfrom
codex/type-check-global-declaration-diagnostics
Nov 20, 2026
Merged

camc314 merged 2 commits into
mainfrom
codex/type-check-global-declaration-diagnostics

Conversation

@camc314

@camc314 camc314 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Ports oxc-project/tsgolint@cc77807 from oxc-project/tsgolint#1270.

With semantic reporting enabled, tsrs-lint now reports:

  • global diagnostics once per program, on its tsconfig and without a range, such as TS2318 for missing required globals
  • declaration diagnostics for listed files when declaration or composite is set, such as TS4094, including with noCheck or noEmit

Declaration diagnostics are collected after every listed file has been checked, then merged with that file's semantic diagnostics. This keeps tsgolint's ordering. Global diagnostics are collected before rules run.

Upstream's e2e scenarios match the Go binary across default, two-checker and non-fast checker modes. They cover multiple tsconfigs, globals found during checking, and inferred programs.

Copilot AI balanced review requested due to automatic review settings November 20, 2026 16: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 20, 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-20T16:43:10.497753Z 849d0d8 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 codex/type-check-global-declaration-diagnostics branch 2 times, most recently from a470e87 to 8bf5c4f Compare November 20, 2026 16:24
@camc314
camc314 changed the base branch from main to codex/no-unnecessary-template-expression-narrowing November 20, 2026 16:24
@codspeed

codspeed Bot commented Nov 20, 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 codex/type-check-global-declaration-diagnostics (849d0d8) with main (c16cc1a)

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

Base automatically changed from codex/no-unnecessary-template-expression-narrowing to main November 20, 2026 16:40
@camc314
camc314 force-pushed the codex/type-check-global-declaration-diagnostics branch from 8bf5c4f to 849d0d8 Compare November 20, 2026 16:41
@camc314
camc314 enabled auto-merge November 20, 2026 16:48
@camc314
camc314 added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 4d59429 Nov 20, 2026
20 checks passed
@camc314
camc314 deleted the codex/type-check-global-declaration-diagnostics branch November 20, 2026 16:54
@github-actions

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run Β· main c16cc1a3b383 β†’ PR merge a110ea888da2 (head 849d0d874006)

Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/engine.rs: patch exceeds the Clef context limit (7946 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 +1.0% +0.001% -1.2% -0.2%
vscode incremental +3.3% +0.002% -0.5% 0.0%
xstate-main check 0.0% -0.002% -1.2% -0.4%
xstate-main incremental -0.2% -0.003% -0.9% +0.2%
webpack check +0.3% +0.006% -1.9% 0.0%
webpack incremental -0.4% +0.005% -3.4% 0.0%
mui-docs check +1.1% -0.015% -1.0% -0.4%
mui-docs incremental +1.0% -0.014% +0.2% +0.2%
Compiler check -0.9% 0.000% +0.2% +1.0%
Compiler incremental -3.3% 0.000% -2.4% -0.3%
Compiler-Unions check 0.0% 0.000% +2.8% +0.3%
Compiler-Unions incremental +1.0% -0.001% +1.3% +0.1%
cal-diy check -1.3% -0.006% +0.2% +0.5%
cal-diy incremental -0.4% +0.002% -0.9% +0.2%
formbricks-web check +1.0% 0.000% -1.1% -0.1%
formbricks-web incremental +5.2% -0.002% -1.9% 0.0%
supabase-studio check -1.7% +0.004% -0.7% -0.1%
supabase-studio incremental -0.6% -0.003% -1.6% -0.1%
t3code-server check -1.6% -0.001% -1.2% -0.1%
t3code-server incremental -0.4% +0.002% +0.7% +0.2%
mikro-orm check +0.4% 0.000% +1.5% 0.0%
mikro-orm incremental -4.2% -0.002% -3.3% 0.0%
next-packages-next check +0.6% +0.001% -0.4% +0.3%
next-packages-next incremental -0.9% -0.003% -0.5% +0.1%
next-root check -1.4% +0.001% -2.8% -0.6%
next-root incremental -1.0% +0.004% -1.1% +0.1%
storybook check +0.6% 0.000% -0.4% +0.6%
storybook incremental -0.3% +0.004% -3.7% -0.3%
nuxt check +0.3% 0.000% +1.4% +0.1%
nuxt incremental +2.8% +0.004% -0.4% -0.3%
playwright check -0.2% 0.000% +0.6% -0.1%
playwright incremental +3.7% +0.001% 0.0% +0.3%
drizzle-orm check -1.0% -0.007% +1.3% +2.0%
drizzle-orm incremental +0.4% +0.005% +4.6% -0.2%
typeorm check +7.1% 0.000% -0.1% -0.3%
typeorm incremental -0.8% 0.000% -4.9% -0.6%
date-fns check +1.9% +0.001% +2.1% +0.2%
date-fns incremental -2.0% -0.009% +0.5% +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 12.273 β†’ 12.374 82,258,655,691 β†’ 82,259,184,406 1.693 β†’ 1.670 1839.7 β†’ 1836.9
vscode incremental 12.571 β†’ 12.461 84,672,907,154 β†’ 84,673,756,689.5 3.713 β†’ 3.730 2160.5 β†’ 2161.4
xstate-main check 0.659 β†’ 0.646 5,566,033,405 β†’ 5,565,940,860 0.141 β†’ 0.139 242.3 β†’ 241.4
xstate-main incremental 0.546 β†’ 0.544 5,728,637,386 β†’ 5,728,561,044.5 0.169 β†’ 0.167 244.7 β†’ 245.2
webpack check 0.964 β†’ 0.963 10,884,853,478.5 β†’ 10,885,229,425 0.207 β†’ 0.201 405.8 β†’ 405.7
webpack incremental 1.159 β†’ 1.153 11,108,372,166.5 β†’ 11,108,577,745 0.313 β†’ 0.314 402.7 β†’ 402.6
mui-docs check 2.537 β†’ 2.548 33,115,059,629 β†’ 33,109,318,478.5 1.000 β†’ 0.986 1228.9 β†’ 1224.3
mui-docs incremental 2.558 β†’ 2.579 34,454,926,221.5 β†’ 34,449,710,481 1.099 β†’ 1.102 1162.0 β†’ 1163.7
Compiler check 0.170 β†’ 0.169 1,775,735,341 β†’ 1,775,734,444 0.076 β†’ 0.075 77.2 β†’ 78.0
Compiler incremental 0.172 β†’ 0.181 1,788,535,191.5 β†’ 1,788,538,176 0.083 β†’ 0.083 80.1 β†’ 79.9
Compiler-Unions check 0.209 β†’ 0.214 3,053,537,559.5 β†’ 3,053,540,444.5 0.109 β†’ 0.110 81.4 β†’ 81.7
Compiler-Unions incremental 0.229 β†’ 0.233 3,065,384,407.5 β†’ 3,065,381,926 0.135 β†’ 0.134 85.2 β†’ 85.3
cal-diy check 2.832 β†’ 2.828 28,970,705,020 β†’ 28,969,581,125 0.857 β†’ 0.849 1355.0 β†’ 1361.2
cal-diy incremental 4.908 β†’ 4.750 30,589,157,065.5 β†’ 30,590,034,525.5 1.990 β†’ 1.983 1264.8 β†’ 1266.9
formbricks-web check 4.473 β†’ 4.454 37,084,224,172 β†’ 37,084,919,643.5 1.112 β†’ 1.144 1581.3 β†’ 1580.2
formbricks-web incremental 5.827 β†’ 5.959 39,687,459,409.5 β†’ 39,686,290,834 1.897 β†’ 1.836 1623.1 β†’ 1623.7
supabase-studio check 4.832 β†’ 4.645 40,816,030,387.5 β†’ 40,817,499,007.5 0.975 β†’ 0.952 1308.0 β†’ 1307.3
supabase-studio incremental 4.866 β†’ 4.710 43,765,651,471.5 β†’ 43,764,692,748 1.138 β†’ 1.141 1366.0 β†’ 1364.9
t3code-server check 4.216 β†’ 4.182 41,055,315,060.5 β†’ 41,054,905,068.5 1.711 β†’ 1.714 1450.2 β†’ 1448.8
t3code-server incremental 3.675 β†’ 3.668 41,578,051,776.5 β†’ 41,578,369,897 1.429 β†’ 1.455 1304.7 β†’ 1307.2
mikro-orm check 4.440 β†’ 4.357 44,483,421,986.5 β†’ 44,484,220,576.5 0.867 β†’ 0.854 1279.3 β†’ 1279.6
mikro-orm incremental 5.072 β†’ 4.719 44,794,475,652 β†’ 44,793,725,007.5 1.240 β†’ 1.189 1260.2 β†’ 1260.2
next-packages-next check 1.752 β†’ 1.822 17,404,592,319 β†’ 17,404,736,722 0.407 β†’ 0.409 558.1 β†’ 559.6
next-packages-next incremental 1.593 β†’ 1.579 17,730,450,347.5 β†’ 17,729,969,425 0.452 β†’ 0.450 563.6 β†’ 564.0
next-root check 1.529 β†’ 1.511 13,962,695,722.5 β†’ 13,962,694,493 0.381 β†’ 0.416 432.9 β†’ 430.5
next-root incremental 1.748 β†’ 1.832 14,424,569,452 β†’ 14,425,156,076.5 0.498 β†’ 0.493 473.2 β†’ 473.6
storybook check 0.941 β†’ 0.947 8,867,223,660 β†’ 8,867,261,597 0.247 β†’ 0.239 396.1 β†’ 398.4
storybook incremental 0.905 β†’ 0.906 9,191,771,858.5 β†’ 9,192,050,910.5 0.299 β†’ 0.291 376.2 β†’ 375.2
nuxt check 1.092 β†’ 1.084 8,500,644,231 β†’ 8,500,679,090 0.248 β†’ 0.248 390.1 β†’ 390.7
nuxt incremental 1.771 β†’ 2.116 8,902,209,842 β†’ 8,902,513,496 0.431 β†’ 0.432 393.3 β†’ 392.1
playwright check 0.747 β†’ 0.732 7,402,989,569.5 β†’ 7,402,937,597.5 0.182 β†’ 0.184 363.1 β†’ 362.8
playwright incremental 0.809 β†’ 0.783 7,574,571,032.5 β†’ 7,574,666,432 0.198 β†’ 0.202 340.4 β†’ 341.5
drizzle-orm check 0.583 β†’ 0.558 5,948,474,784.5 β†’ 5,948,343,286 0.183 β†’ 0.185 374.8 β†’ 382.2
drizzle-orm incremental 0.646 β†’ 0.653 6,119,493,360 β†’ 6,119,848,275 0.208 β†’ 0.218 346.6 β†’ 345.9
typeorm check 0.797 β†’ 0.900 6,392,597,695.5 β†’ 6,392,502,549 0.179 β†’ 0.183 227.0 β†’ 226.3
typeorm incremental 0.732 β†’ 0.715 6,769,485,340 β†’ 6,769,612,701.5 0.227 β†’ 0.214 234.5 β†’ 233.1
date-fns check 0.319 β†’ 0.324 3,347,498,770 β†’ 3,347,494,005 0.099 β†’ 0.100 153.1 β†’ 153.3
date-fns incremental 0.373 β†’ 0.382 3,584,220,764 β†’ 3,583,975,763.5 0.154 β†’ 0.158 164.2 β†’ 164.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 -2.8% -0.2% +0.2% 37258, identical
webpack TSRS_FAST=1 -1.4% -0.5% +0.2% 37258, identical
drizzle-orm default +3.1% +2.8% -0.1% 7057, identical
drizzle-orm TSRS_FAST=1 +14.2% +3.2% +0.2% 7057, identical
xstate-main default +1.9% +1.4% +1.7% 6489, identical
xstate-main TSRS_FAST=1 -6.4% -3.6% -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 0.393 β†’ 0.381 1.977 β†’ 1.973 466.8 β†’ 467.5
webpack TSRS_FAST=1 0.393 β†’ 0.382 1.983 β†’ 1.995 467.2 β†’ 468.2
drizzle-orm default 0.265 β†’ 0.274 1.388 β†’ 1.452 403.1 β†’ 402.7
drizzle-orm TSRS_FAST=1 0.264 β†’ 0.344 1.383 β†’ 1.651 403.0 β†’ 403.8
xstate-main default 0.348 β†’ 0.341 1.535 β†’ 1.523 338.5 β†’ 344.3
xstate-main TSRS_FAST=1 0.391 β†’ 0.381 1.673 β†’ 1.660 342.8 β†’ 342.6

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