Skip to content

feat: support typescript-go checks#78

Merged
chenjiahan merged 3 commits into
mainfrom
david/feat-tsgo-support
Jun 9, 2026
Merged

feat: support typescript-go checks#78
chenjiahan merged 3 commits into
mainfrom
david/feat-tsgo-support

Conversation

@Timeless0911

@Timeless0911 Timeless0911 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds experimental TypeScript Go support by resolving @typescript/native-preview/package.json when typescript.tsgo is enabled, while preserving the regular project TypeScript path for non-tsgo checks.

Related Links

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f7d62bab-9fc3-4d29-9e40-1834073a1e95

📥 Commits

Reviewing files that changed from the base of the PR and between 7316b1b and af518bc.

📒 Files selected for processing (1)
  • src/index.ts

📝 Walkthrough

Walkthrough

This 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 @typescript/native-preview as an optional peer/dev dependency, adds a project-root package resolution helper, resolves both regular typescript and @typescript/native-preview paths from the project root, sets tsgo: false by default, conditionally rewrites merged typescript.typescriptPath when tsgo is enabled, warns and returns early if the selected package is unavailable, and adds Playwright tests plus test fixtures exercising tsgo diagnostics and issue exclusion.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely describes the main feature being added: TypeScript Go type checking support.
Description check ✅ Passed The description clearly explains the purpose of the PR: adding experimental TypeScript Go support with conditional path resolution, which aligns with the actual changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch david/feat-tsgo-support

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ea0ff7c and 8c6971e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • README.md
  • package.json
  • pnpm-workspace.yaml
  • src/index.ts
  • test/typescript-go/index.test.ts
  • test/typescript-go/src/index.ts
  • test/typescript-go/tsconfig.json

Comment thread README.md
Comment thread src/index.ts Outdated
Comment thread pnpm-workspace.yaml Outdated
Comment thread README.md Outdated

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8c6971e and 7316b1b.

📒 Files selected for processing (4)
  • README.md
  • pnpm-workspace.yaml
  • src/index.ts
  • test/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

Comment thread src/index.ts Outdated
@chenjiahan chenjiahan merged commit 2039b72 into main Jun 9, 2026
6 checks passed
@chenjiahan chenjiahan deleted the david/feat-tsgo-support branch June 9, 2026 04:29
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.

2 participants