chore(deps): typecheck with TypeScript 7 - #9923
Merged
Merged
Conversation
TypeScript 7.0 ships the native compiler without a programmatic API, so typescript-eslint and @rollup/plugin-typescript keep consuming the TypeScript 6 API through @typescript/typescript6, installed under the typescript name. `tsc` resolves to the native 7.0 compiler; the compatibility package ships its binary as `tsc6`, so the two coexist. No source change is needed. TypeScript 7 inherits the strict-by-default behavior of 6.0, which #9922 already resolved, and typechecks clean. Mirrors vega/vega#4324. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5 tasks
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.
Typechecks with TypeScript 7, mirroring vega/vega#4324.
The diff is 2 files —
package.jsonandpackage-lock.json. No source file is touched.Why no source changes
TypeScript 7 inherits the
strict-by-default behavior introduced in 6.0, and #9922 already resolved every error that surfaced from it. Running the native 7.0 compiler against this tree gives 0 errors, so the work is already done — this PR only changes which compiler runs.Dependency arrangement
TypeScript 7.0 ships the native compiler and no programmatic API. Tools that consume the compiler API therefore cannot run against it yet, and this repo has two of them —
typescript-eslintand, importantly,@rollup/plugin-typescript, which emits our published bundle and.d.tsfiles. Microsoft publishes@typescript/typescript6for exactly this, built for side-by-side installation via npm aliases:{ "devDependencies": { "@typescript/native": "npm:typescript@^7.0.2", "typescript": "npm:@typescript/typescript6@^6.0.2" } }The two do not collide, because the compatibility package deliberately ships its binary as
tsc6rather thantsc:tsc@typescript/native)tsc6@typescript/typescript6)CI's
npx tscstep therefore typechecks with 7.0, whiletypescript-eslintand the rollup build keep the 6.0 API under thetypescriptname.Verification
npx tsc --version→ 7.0.2;npx tsc→ 0 errors.@rollup/plugin-typescriptstill emits via the TypeScript 6 API, so this needed proving rather than assuming: clean builds before and after produce the same 378 files with identical checksums (bundle, minified bundle, all.d.ts, all source maps).npx vitest run test/— 3346 passed.npx vitest run examples/— 3277 passed.npm run lint— clean.npm run schema— regeneratedbuild/vega-lite-schema.jsonis unchanged. (ts-json-schema-generatorv2 bundles its owntypescript@5.9.3as a direct dependency, so schema generation is unaffected either way; chore: generate schema with ts-json-schema-generator v3 (native TypeScript 7) #9921 moves it to the native v3 independently of this PR.)Note on the lockfile
Applying the alias with an incremental
npm installis not sufficient — npm keeps the previously resolved plaintypescriptpackage in the tree and lockfile, which does ship atscbinary and then competes with the native one, leavingtscresolution up to install order. The lockfile here was produced by dropping the stalenode_modules/typescriptentry and re-resolving, and verified withnpm ci:🤖 Generated with Claude Code