Skip to content

chore(deps): typecheck with TypeScript 7 - #9923

Merged
domoritz merged 1 commit into
mainfrom
typecheck-with-typescript-7
Aug 10, 2026
Merged

chore(deps): typecheck with TypeScript 7#9923
domoritz merged 1 commit into
mainfrom
typecheck-with-typescript-7

Conversation

@domoritz

Copy link
Copy Markdown
Member

Typechecks with TypeScript 7, mirroring vega/vega#4324.

The diff is 2 files — package.json and package-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-eslint and, importantly, @rollup/plugin-typescript, which emits our published bundle and .d.ts files. Microsoft publishes @typescript/typescript6 for 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 tsc6 rather than tsc:

binary compiler
tsc 7.0.2 native (from @typescript/native)
tsc6 6.0.2 JS (from @typescript/typescript6)

CI's npx tsc step therefore typechecks with 7.0, while typescript-eslint and the rollup build keep the 6.0 API under the typescript name.

Verification

  • npx tsc --version7.0.2; npx tsc0 errors.
  • The build output is byte-identical. @rollup/plugin-typescript still 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 — regenerated build/vega-lite-schema.json is unchanged. (ts-json-schema-generator v2 bundles its own typescript@5.9.3 as 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 install is not sufficient — npm keeps the previously resolved plain typescript package in the tree and lockfile, which does ship a tsc binary and then competes with the native one, leaving tsc resolution up to install order. The lockfile here was produced by dropping the stale node_modules/typescript entry and re-resolving, and verified with npm ci:

node_modules/typescript -> @typescript/typescript6@6.0.2  {"tsc6": "./bin/tsc6"}
node_modules/.bin       -> tsc (7.0.2 native), tsc6

🤖 Generated with Claude Code

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>
@domoritz
domoritz requested a review from a team as a code owner August 10, 2026 00:16
@domoritz
domoritz merged commit a2291fb into main Aug 10, 2026
13 checks passed
@domoritz
domoritz deleted the typecheck-with-typescript-7 branch August 10, 2026 00:30
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.

1 participant