Repository navigation
Conversation
TypeScript 7 doesn't ship the JS compiler API anymore, `import ts from "typescript"` just gets you a version string. The optional `typescript` peer resolves to whatever the project compiles with, so in toolkit (now on 7) the analyzer crashes on `ts.ScriptTarget.Latest`. Swap the peer for an optional `@typescript/typescript6`, TypeScript's own package for code that still needs the 6 API. The analyzer only parses, so nothing else changes and it stops caring which tsc the project uses. The alias inside that package is a full typescript@6 with its own `tsc` bin, and bun hoists it over ours, so build and typecheck now call this repo's 5.9 compiler by path. The README calls out the same thing for npm and bun users. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
TypeScript 7 doesn't ship the JS compiler API anymore,
import ts from "typescript"only gets you a version string. The optionaltypescriptpeer resolves to whatever the project compiles with, so source-analysis crashes onts.ScriptTarget.Latestin any project on 7.Swaps the peer for an optional
@typescript/typescript6, TypeScript's own package for code that still needs the 6 API. The analyzer only parses, so it behaves the same and no longer depends on the project's compiler.One gotcha:
@typescript/typescript6depends on@typescript/old, a full typescript@6 alias with its owntscbin. npm and bun hoist it, sonode_modules/.bin/tscbecomes 6.0.3 even next to typescript 5.9 or 7 (pnpm keeps it nested). Build and typecheck here now run the repo's own compiler by path, and the README mentions it.Follow-up to #115