feat: support typescript-go checks#78
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds experimental TypeScript Go (tsgo) support to the rsbuild type-check plugin. It updates README defaults and docs, modifies package.json and pnpm workspace config to include and mark 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 122-124: The snippet uses an undeclared identifier tsgo when
setting typescriptPath; update the example so the default is a concrete,
copy-pasteable path and only use tsgo conditionally. Change the expression
around typescriptPath to use a safe check (e.g., test typeof tsgo !==
'undefined' or use a ternary that falls back to require.resolve('typescript'))
so typescriptPath resolves via require.resolve('typescript') by default and only
resolves `@typescript/native-preview` when tsgo is actually present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f8cc3c9a-bac0-4184-a5af-f284342962b5
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
README.mdpackage.jsonpnpm-workspace.yamlsrc/index.tstest/typescript-go/index.test.tstest/typescript-go/src/index.tstest/typescript-go/tsconfig.json
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/index.ts`:
- Around line 148-158: The current equality check on
mergedOptions.typescript.typescriptPath can overwrite a user-provided value if
it happens to equal projectTypescriptPath/projectTsgoPath; instead, track origin
of the default path with a sentinel and only swap when the path is the
plugin-provided default. Modify the code that initially sets the default path to
record a flag/marker on mergedOptions.typescript (e.g.,
typescript.__isDefaultPath or typescript.__defaultPathOrigin) and then change
the conditional in the block that references
mergedOptions.typescript.typescriptPath to check that sentinel (and
mergedOptions.typescript exists) rather than comparing string equality against
projectTypescriptPath/projectTsgoPath; only perform the tsgo vs project swap
when the sentinel indicates the value came from the plugin default.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fad54dce-08a7-491a-bf9a-7f228d76ee2c
📒 Files selected for processing (4)
README.mdpnpm-workspace.yamlsrc/index.tstest/typescript-go/index.test.ts
💤 Files with no reviewable changes (1)
- test/typescript-go/index.test.ts
✅ Files skipped from review due to trivial changes (1)
- README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm-workspace.yaml
Summary
This PR adds experimental TypeScript Go support by resolving
@typescript/native-preview/package.jsonwhentypescript.tsgois enabled, while preserving the regular project TypeScript path for non-tsgo checks.Related Links