Skip to content

Commit 31d9b4e

Browse files
deps(typescript): Add TypeScript 7.0.2 alongside TS 6 via npm aliases (#538)
Add TypeScript 7.0.2 (native Go port, \~10x faster) as `@typescript/native` for CLI use, while keeping TypeScript 6 as the default `typescript` package for tools that need the programmatic API (typescript-eslint, Vue/Volar). TS 7 has no programmatic API (coming in 7.1), which breaks `typescript-eslint` and editor tooling. The npm alias approach lets both versions coexist: `npx tsc` runs TS 7, while ESLint/Volar resolve `typescript` to TS 6. Document the dual setup in AGENTS.md including the package.json aliases and usage instructions. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added guidance on using the project’s TypeScript tooling, including when to use `tsc` versus `tsc6`. * **Chores** * Updated TypeScript development tooling and added native TypeScript support. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 52dc7c8 commit 31d9b4e

3 files changed

Lines changed: 412 additions & 181 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ CI order: `lint → test → generate` (not `build`).
2323

2424
## TypeScript setup
2525

26+
TypeScript 7.0.2 is installed side-by-side with TypeScript 6.0.x via npm aliases because TS 7 has no programmatic API (coming in 7.1), which breaks `typescript-eslint` and Vue/Volar editor tooling:
27+
28+
```json
29+
"@typescript/native": "npm:typescript@^7.0.2",
30+
"typescript": "npm:@typescript/typescript6@^6.0.2"
31+
```
32+
33+
- `npx tsc` — runs **TypeScript 7** CLI (native Go port, ~10x faster)
34+
- `npx tsc6` — runs **TypeScript 6** for tools that need the API
35+
- ESLint, Volar, etc. resolve `typescript` to TS 6 via the alias
36+
2637
`tsconfig.json` only extends `.nuxt/tsconfig.json`, which is generated. After a fresh clone, run `pnpm install` (postinstall runs `nuxt prepare` automatically) before TypeScript will resolve types.
2738

2839
## Testing

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"happy-dom": "^20.10.6",
2424
"jsdom": "^29.1.1",
2525
"nuxt": "^4.4.8",
26-
"typescript": "^6.0.3",
26+
"@typescript/native": "npm:typescript@^7.0.2",
27+
"typescript": "npm:@typescript/typescript6@^6.0.2",
2728
"vite-plugin-eslint2": "^5.3.0",
2829
"vitest": "^4.1.10"
2930
},

0 commit comments

Comments
 (0)