Skip to content

fix: type-check .tsrx with its owning tsconfig and accept later tsgolint 7.0 - #219

Merged
thejackshelton merged 2 commits into
mainfrom
fix/type-check-owning-tsconfig
Oct 23, 2026
Merged

thejackshelton merged 2 commits into
mainfrom
fix/type-check-owning-tsconfig

Conversation

@thejackshelton

@thejackshelton thejackshelton commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #218.

1. .tsrx was type-checked as React JSX, ignoring the package tsconfig

Root cause. A projection reaches tsgolint as an in-memory View.tsrx.tsx source override. tsgolint's overlay FS answers FileExists/ReadFile for it but not GetAccessibleEntries, and a tsconfig's include is expanded by listing directories. So no project ever listed a projection. tsgolint's debug log (OXC_LOG=debug) showed every one as Unmatched file, checked in the inferred project with default options. That explains every error in the report: TS2875 react/jsx-runtime, TS2786/TS6229, and TS2591 process despite types: ["node"]. No include shape could fix it, and tsgolint main still has the same overlay.

Fix. The same overlay carries each owning tsconfig too. The owner is found the way tsgolint finds a .ts file's: nearest tsconfig.json/jsconfig.json, then its references breadth first, then ancestor directories. extends, include (directory entries, globs, and **/*.tsrx), exclude, and files are resolved. The override is that config's JSON with the projections appended to files. Nothing is written to disk.

--tsconfig PATH (new on oxc-tsrx-lint, forwarded by the drop-in oxlint) names one project for every .tsrx file. It is reached by adding it to references of the config tsgolint starts at, or of an in-memory stub when there is none.

2. Exact oxlint-tsgolint 7.0.2002 check

  • Discovery prefers the tsgolint @tsrx/oxc itself depends on. The launcher exports it as OXC_TSRX_BUNDLED_TSGOLINT; OXLINT_TSGOLINT_PATH still wins.
  • Discovery follows pnpm's store layout (node_modules/oxlint-tsgolint → sibling @oxlint-tsgolint/<platform>) before the .bin shim, which cannot be verified.
  • Every 7.0 release from 7.0.2002 on is accepted. cmd/tsgolint/{headless,payload,overlay}.go are byte-identical from v7.0.2002 through v7.0.2005; only main.go changed. Oxlint 1.86+ requires >= 7.0.2003.

Tests

  • tests/type-aware: owning-tsconfig fixtures (directory include, extends with JSONC, a solution tsconfig whose reference includes **/*.tsrx), --tsconfig on the native CLI and through the drop-in oxlint, and a 7.0.2099 tsgolint in a pnpm store layout, ./ and ../ file paths (0.20.0 panicked inside tsgolint on these), and an unreadable --tsconfig exiting 2. All eight new tests fail against the 0.20.0 binary from the report and pass here.
  • Rust unit tests for include/exclude matching and the version range.

…int 7.0

Fixes #218.

tsgolint's source-override overlay answers FileExists/ReadFile for an
in-memory projection but not directory listings, and a tsconfig's
`include` is expanded by listing directories. No project ever listed a
`View.tsrx.tsx` projection, so every one fell into tsgolint's inferred
project and was checked with default options: React JSX, no `paths`,
no `types`.

Each owning tsconfig, found the way tsgolint finds a `.ts` file's
(nearest config, its references breadth first, then ancestors, with
`extends`, `include`, `exclude`, and `files` resolved), now rides the
same overlay with the projections appended to `files`. `--tsconfig PATH`
names one project for every `.tsrx` file, by referencing it from the
config tsgolint starts at. The drop-in `oxlint` forwards the flag.
Nothing is written to disk.

tsgolint discovery now prefers the copy `@tsrx/oxc` depends on (the
launcher exports it as OXC_TSRX_BUNDLED_TSGOLINT), follows pnpm's store
layout past the `.bin` shim, and accepts every 7.0 release from
7.0.2002 on: the headless protocol, payload, and overlay are unchanged
through 7.0.2005, and Oxlint 1.86+ requires >= 7.0.2003.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a904320. Configure here.

tsgolint panics with "fileName should be normalized and absolute" on a
config path it derives from `./src/View.tsrx` (0.20.0 crashed the same
way), and the synthetic tsconfig's normalized `files` entries could miss
a raw virtual path. Type-lane paths are now resolved lexically where
they are made, so the payload, the overlay keys, the tsconfig `files`,
and the diagnostics tsgolint answers with all carry one form.

A `--tsconfig` that cannot be read as a tsconfig object now exits 2
instead of silently checking in the inferred project.
@thejackshelton

Copy link
Copy Markdown
Contributor Author

Merging with one red check, Clean install / Vite+ 0.3.2 and 0.3.3. It is not caused by this change. The job's npm audit --audit-level=high of a fresh Vite+ consumer now reports vite-plus <= 1.0.0 as high severity, from the Vite, launch-editor and vitest advisories published today. Every supported Vite+ 0.3.x release is in that range, so main fails the same way. Raising the supported Vite+ line to 1.x is separate work.

@thejackshelton
thejackshelton merged commit 65fe72f into main Oct 23, 2026
12 of 13 checks passed
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.

oxc-tsrx-lint --type-check ignores the package tsconfig (checks .tsrx as React JSX) and requires exactly oxlint-tsgolint 7.0.2002

1 participant