Skip to content

Upgrade to TypeScript 7 (tsgo)#167

Draft
ask-bonk[bot] wants to merge 1 commit into
mainfrom
opencode/issue166-20260422105421
Draft

Upgrade to TypeScript 7 (tsgo)#167
ask-bonk[bot] wants to merge 1 commit into
mainfrom
opencode/issue166-20260422105421

Conversation

@ask-bonk
Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot commented Apr 22, 2026

Here's a summary of the TypeScript 7 upgrade:

Changes Made

package.json

  • Added @typescript/native-preview: "beta" -- installs TypeScript 7.0 (tsgo) native compiler (v7.0.0-dev.20260421.2)
  • Changed typescript to npm:@typescript/typescript6@^6.0.0 -- aliases the typescript package to TS6 compatibility package, so tooling that depends on the typescript programmatic API (vitest, wrangler, etc.) continues to work. This follows the recommended side-by-side approach from the TS7 blog post.
  • Added "tsc": "tsgo" script -- maps bun run tsc to tsgo, so all existing CI commands (bun run tsc --noEmit) transparently invoke the TS7 native compiler without needing workflow file changes.

tsconfig.json

  • Removed allowSyntheticDefaultImports: true -- in TS7, esModuleInterop is always assumed true and allowSyntheticDefaultImports cannot be set to false, making this setting redundant.
  • Changed module from "es2022" to "esnext" -- aligns with TS7's new default. The es2022 value still works but esnext is the recommended default going forward.

Results

  • Type checking: tsgo --noEmit passes with zero errors
  • Tests: All 118 tests pass (2 test files)
  • Lint: Clean (1 pre-existing warning unrelated to this change)

Workflow files -- no changes needed

The "tsc": "tsgo" script alias in package.json means both .github/workflows/test.yml (line 23: bun run tsc --noEmit) and .github/workflows/deps-update.yml (line 39: prompt referencing bun run tsc --noEmit) will automatically use tsgo without any modifications. This also avoids the workflows permission issue that blocked the previous attempt.

Closes #166

github run

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@ask-bonk ask-bonk Bot mentioned this pull request Apr 22, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 22, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
ask-bonk e6e6cd8 Apr 22 2026, 10:57 AM

@elithrar elithrar marked this pull request as draft April 22, 2026 11:50
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.

try TypeScript 7

0 participants