Repository navigation
fix: type-check .tsrx with its owning tsconfig and accept later tsgolint 7.0 - #219
Merged
Merged
Conversation
…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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ 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.
Contributor
Author
|
Merging with one red check, |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #218.
1.
.tsrxwas type-checked as React JSX, ignoring the package tsconfigRoot cause. A projection reaches tsgolint as an in-memory
View.tsrx.tsxsource override. tsgolint's overlay FS answersFileExists/ReadFilefor it but notGetAccessibleEntries, and a tsconfig'sincludeis expanded by listing directories. So no project ever listed a projection. tsgolint's debug log (OXC_LOG=debug) showed every one asUnmatched file, checked in the inferred project with default options. That explains every error in the report: TS2875react/jsx-runtime, TS2786/TS6229, and TS2591processdespitetypes: ["node"]. Noincludeshape 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
.tsfile's: nearesttsconfig.json/jsconfig.json, then its references breadth first, then ancestor directories.extends,include(directory entries, globs, and**/*.tsrx),exclude, andfilesare resolved. The override is that config's JSON with the projections appended tofiles. Nothing is written to disk.--tsconfig PATH(new onoxc-tsrx-lint, forwarded by the drop-inoxlint) names one project for every.tsrxfile. It is reached by adding it toreferencesof the config tsgolint starts at, or of an in-memory stub when there is none.2. Exact
oxlint-tsgolint7.0.2002 check@tsrx/oxcitself depends on. The launcher exports it asOXC_TSRX_BUNDLED_TSGOLINT;OXLINT_TSGOLINT_PATHstill wins.node_modules/oxlint-tsgolint→ sibling@oxlint-tsgolint/<platform>) before the.binshim, which cannot be verified.cmd/tsgolint/{headless,payload,overlay}.goare byte-identical from v7.0.2002 through v7.0.2005; onlymain.gochanged. Oxlint 1.86+ requires>= 7.0.2003.Tests
tests/type-aware: owning-tsconfig fixtures (directoryinclude,extendswith JSONC, a solution tsconfig whose reference includes**/*.tsrx),--tsconfigon the native CLI and through the drop-inoxlint, 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--tsconfigexiting 2. All eight new tests fail against the 0.20.0 binary from the report and pass here.