chore: upgrade typescript to 7.0.2 - #452
Conversation
- typescript 7.0.2 in ingest, lib, terminal, scripts (peer); web stays 5.7.3 because next 15 requires the TS JS API that v7 (native compiler) no longer ships - root keeps a typescript 5.7.3 devDep so hoisted tooling (typescript-eslint, which has no TS7-compatible release) still resolves a working JS API - swap ts-node -> tsx (ts-node cannot load TS7): dev/production scripts, lib containers runScript, ingest Dockerfile CMD - web lint: next lint -> eslint . (next's TS preflight crashes on TS7), ignore generated/CJS config files, autofix tailwind.config.ts semicolons - fix NodeJS.Timer -> ReturnType<typeof setInterval> (removed overload in TS7)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
- drop root typescript 5.7.3 shim; typescript resolves to 7.0.2 everywhere - replace @typescript-eslint (requires the removed TS JS API, no TS7-compatible release) with @babel/eslint-parser + preset-typescript/react; same core and react rules, no-unused-vars scoped to skip PascalCase type imports - strip eslint-disable comments referencing the removed no-explicit-any rule - web: next 15 -> 16 (Turbopack parses tsconfig itself) with experimental.useTypeScriptCli so typechecking runs through the native tsc; tsconfig target es5 -> ES2017 (es5 removed in TS7), exclude vitest specs from next typecheck, drop unused eslint-config-next
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
lint: - no-unused-vars args:'none' for ts — core rule can't see constructor parameter properties through babel, produced 4 false positives - narrow varsIgnorePattern to PascalCase; scope preset-react to jsx/tsx - lint web's next.config.js/postcss.config.js via globals override instead of ignoring them - drop stale @typescript-eslint/ban-ts-comment directive in db deps: - regenerate bun.lock, prunes ts-node - pin hoisted linker (bun 1.3 defaults to isolated, which breaks phantom deps and both Dockerfile CMDs) - declare tsx at root so ../../node_modules/.bin/tsx resolves in the ingest image web: - set turbopack.root, drop stray yarn.lock - tsconfig.vitest.json so specs keep type checking and @/* paths docs: e2e entrypoint is bun --filter ingest test:containers
Summary
Moves the entire repo to typescript 7.0.2 (the native Go compiler) — every package, one version, no 5.x anywhere. TS7 ships no JS compiler API, so every tool that consumed the old API had to change: ts-node is replaced with tsx, @typescript-eslint (no TS7-compatible release, peer caps at <6.1.0) is replaced with @babel/eslint-parser, and web moves to next 16 whose Turbopack build and
experimental.useTypeScriptClitypecheck work against the native compiler.How to review
eslint.config.mjs: parser swapped to @babel/eslint-parser + preset-typescript/react. Core and react rules are unchanged;no-undef/no-redeclareoff for TS files (the compiler owns those, matching what @typescript-eslint/recommended did);no-unused-varsin TS files skips PascalCase names since babel can't see type-position usage. The ~36 staleeslint-disable @typescript-eslint/no-explicit-anycomments are stripped — the rule no longer exists.ts-node→tsxin ingest/terminal dev+production scripts,docker/ingest.DockerfileCMD, andpackages/lib/helpers/containers.tsrunScript.experimental.useTypeScriptClienabled (typecheck via native tsc), tsconfigtargetes5 → ES2017 (es5 removed in TS7), vitest specs excluded from next's typecheck, lint scriptnext lint→eslint .(next lint was removed in 16 and crashed on TS7 anyway), unused eslint-config-next dropped.NodeJS.Timer→ReturnType<typeof setInterval>in lib: TS7 drops the overload acceptingNodeJS.Timer.Test plan
bun --filter <pkg> lintpasses for ingest, lib, terminal, web (the CI gate) — 0 errors, warning count on par with beforetsc --noEmit(tsc 7.0.2) clean for ingest and terminal (lib's tsc failures predate this PR — spec files lack test-runner types under 5.7.3 too).tsrequires, workers come up; fails only at redis, which wasn't running locally)next buildpasses end to end — Turbopack compile + native-tsc typecheckmake devwith docker (not run here)Risk / impact
no-explicit-anywarnings are gone) andno-unused-varscan't see type-position usage, hence the PascalCase ignore heuristic.--transpile-only). Type checking istsc --noEmitwith the native tsc.