Skip to content

feat(lint): use tsrs as the experimental default backend - #3352

Draft
fengmk2 wants to merge 7 commits into
mainfrom
codex/tsrs-lint-bench
Draft

fengmk2 wants to merge 7 commits into
mainfrom
codex/tsrs-lint-bench

Conversation

@fengmk2

@fengmk2 fengmk2 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

vp lint currently uses tsgolint for type-aware rules and TypeScript diagnostics. This draft selects tsrs-lint by default.

The CLI pins tsrs@0.22.0-ts7.1.0-beta as a production dependency and resolves its bundled executable. Version output and toolchain metadata report tsrs. The global version command also supports older installations that use tsgolint. The related RFCs describe the backend, overrides, and platform limits.

No environment variable is required for the default backend:

vp lint --type-aware --type-check
vp check

For vp check, enable lint.options.typeAware and lint.options.typeCheck in the project config. Explicit OXLINT_TSGOLINT_PATH overrides take precedence. To select the comparison's Go backend:

vp add -D oxlint-tsgolint@7.0.2005
OXLINT_TSGOLINT_PATH="$PWD/node_modules/.bin/tsgolint" vp lint --type-aware --type-check

oxlint-tsgolint remains a development dependency for comparisons. The benchmark selects it explicitly for the Go baseline.

Codespaces performance

Both backends ran on one Codespace with four vCPUs and 16 GB RAM. The main run used an AMD EPYC 9V74. The comparison uses Oxlint 1.91.0, oxlint-tsgolint@7.0.2005, and tsrs@0.22.0-ts7.1.0-beta.

Elapsed time is the median of ten paired runs after warm-ups:

Project Workload Go (s) tsrs (s) Reduction
Vite+ Type-aware rules 3.712 2.212 40.4%
Vite+ Rules and TypeScript diagnostics 4.612 2.382 48.4%
Vite+ Full vp check 5.842 3.554 39.2%
vinext Type-aware rules 52.028 45.363 12.8%
vinext † Rules and TypeScript diagnostics 54.192 44.794 17.3%
vinext Full vp check 62.325 50.355 19.2%

† After the Codespace restarted, this clean timing repetition used an EPYC 7763. Both backends within each row used the same CPU. The CPU change prevents a strict comparison of absolute times across workloads.

Peak memory is the median of five separate paired runs after warm-ups:

Project Workload Go (GiB) tsrs (GiB) Reduction
Vite+ Type-aware rules 1.175 0.930 20.9%
Vite+ Rules and TypeScript diagnostics 1.345 0.984 26.8%
Vite+ Full vp check 1.438 1.017 29.3%
vinext Type-aware rules 4.382 3.030 30.8%
vinext Rules and TypeScript diagnostics 4.903 3.166 35.4%
vinext Full vp check 5.413 3.292 39.2%

Memory is the sampled peak RSS of the CLI process tree, including child processes. Shared pages can count more than once. Sampling can miss short peaks. Timing runs exclude sampling overhead.

Vite+ used Node.js 24.22.2; vinext used Node.js 26.13.0 at 249088af3. Lint used four threads. Vinext lint used sorted checker scheduling; full checks used default scheduling. The original JS plugin rules remain enabled, including vinext-utils/prefer-shared-utils.

The report contains ranges, raw samples, and the excluded timing set. The Codespaces recipe pins the source, dependencies, and method.

Smoke-test results

On macOS ARM64, 3,403 unit tests, 50 selected CLI snapshots, and five Rust version tests passed. One unit test was skipped. A fresh package installation worked without oxlint-tsgolint. Smoke fixtures matched Go diagnostics, suppression comments, and automatic fixes. Nested tasks, version output, explicit overrides, and expected backend failures also passed.

On Linux x64 with glibc, both backends passed all 12 validation commands and all 226 benchmark invocations, including warm-ups and the timing repetition. Full checks passed for Vite+ (385 source files) and vinext (1,828 source files).

The CLI JavaScript came from this branch. The local native binding and core artifacts came from published 1.5.0 packages. These checks do not replace a full release build or establish complete compiler parity.

Windows ARM64 limitation

tsrs@0.22.0-ts7.1.0-beta does not provide a Windows ARM64 binary. This supported Vite+ target needs an upstream binary or an explicit fallback before release. This draft adds no automatic Go fallback. Other runtime targets still need validation; Windows executable resolution has unit coverage only.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Staging deployment successful!

Preview: https://viteplus-staging.void.app/
Commit: ce98494

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-tsrs-lint-bench-viteplus-dev.voidzero-docs.workers.dev (commit ce98494)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://77d3768c-viteplus-dev.voidzero-docs.workers.dev ce98494 2026-11-05T16:30:14.955Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4c582881-viteplus-dev.voidzero-docs.workers.dev 22b07bd 2026-11-05T07:24:53.242Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://75f9831d-viteplus-dev.voidzero-docs.workers.dev f3bb020 2026-11-05T07:13:34.196Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://13805731-viteplus-dev.voidzero-docs.workers.dev 9c80ebf 2026-11-04T14:41:31.405Z Visit the dashboard ↗

@fengmk2 fengmk2 closed this Nov 4, 2026
@fengmk2 fengmk2 changed the title perf(lint): benchmark the experimental tsrs-lint backend perf(lint): use tsrs as the experimental default backend Nov 5, 2026
@fengmk2 fengmk2 reopened this Nov 5, 2026
@socket-security

socket-security Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​tsrs@​0.22.0-ts7.1.0-beta1001001009490

View full report

@fengmk2 fengmk2 changed the title perf(lint): use tsrs as the experimental default backend feat(lint): use tsrs as the experimental default backend Nov 5, 2026
Comment thread docs/guide/lint.md
This path is powered by [tsgolint](https://github.com/oxc-project/tsgolint) on top of the TypeScript 7 (aka TypeScript Go) toolchain. It gives Oxlint access to type information and allows type checking directly via `vp lint` and `vp check`.
This experimental build uses [tsrs](https://github.com/oxc-project/tsrs), a Rust port of the TypeScript 7 compiler. Its `tsrs-lint` executable gives Oxlint access to type information and allows type checking directly via `vp lint` and `vp check`.

### Select another backend

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

CLI artifact sizes (ce98494)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.33 MiB 2.33 MiB +94 B (+0.00%)
packages/core/dist Directory total 4.08 MiB 4.08 MiB 0 B (0.00%)
Combined package dist Directory total 6.41 MiB 6.41 MiB +94 B (+0.00%)
vp (Linux x64) Binary 8.31 MiB 8.31 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 3.80 MiB 3.80 MiB +13 B (+0.00%)
NAPI (Linux x64) Binary 36.20 MiB 36.20 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 14.44 MiB 14.44 MiB -34 B (-0.00%)
vp (macOS ARM64) Binary 5.42 MiB 5.42 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 3.23 MiB 3.23 MiB -132 B (-0.00%)
NAPI (macOS ARM64) Binary 43.01 MiB 43.01 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 18.64 MiB 18.64 MiB -44 B (-0.00%)
vp (Windows x64) Binary 6.15 MiB 6.16 MiB +512 B (+0.01%)
vp (Windows x64) gzip -9 2.85 MiB 2.85 MiB +2 B (+0.00%)
NAPI (Windows x64) Binary 32.32 MiB 32.32 MiB 0 B (0.00%)
NAPI (Windows x64) gzip -9 13.22 MiB 13.22 MiB +50 B (+0.00%)
Trampoline (Windows x64) Binary 13.50 KiB 13.50 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 7.09 KiB 7.09 KiB 0 B (0.00%)
Installer (Windows x64) Binary 4.66 MiB 4.66 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.23 MiB 2.23 MiB +1 B (+0.00%)

@fengmk2
fengmk2 force-pushed the codex/tsrs-lint-bench branch from f3bb020 to 22b07bd Compare November 5, 2026 07:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant