Skip to content

build(ts): Upgrade to TypeScript 7 with strict compiler checks - #2171

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
build/typescript-7-strict
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
build/typescript-7-strict

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Moves the workspace packages and the example app from TypeScript 6.0.3 to 7.0.2. It also adopts the strict compiler settings from getsentry/eng-pipes through a new root tsconfig.base.json, which every package tsconfig.json now extends.

New checks: noUncheckedIndexedAccess, noImplicitOverride, noImplicitReturns, noFallthroughCasesInSwitch, noUnusedLocals, noUnusedParameters, noUncheckedSideEffectImports, erasableSyntaxOnly, allowUnreachableCode: false, and allowUnusedLabels: false.

Not included yet: exactOptionalPropertyTypes. eng-pipes enables it, but here it reports about 1,000 errors across hundreds of option and record types. That is a separate migration, so I left it for a follow-up.

Source fixes for the new checks. Most are small guards for indexed access that can be undefined. Other changes:

  • Constructor parameter properties are now explicit fields, and SubscribedReplyReason is now a const object, because erasableSyntaxOnly rejects both.
  • Callbacks that fell off the end now return undefined.
  • Dead fallback returns after exhaustive switches are gone.
  • Tests use ! where the fixture already proves the value exists.

Tooling changes. TS 7 does not ship the JS compiler API.

  • @sentry/junior stays on tsdown, which now emits types with TS 7. StructuredToolResultEnvelope is exported because declaration emit has to name it, and src/cli/** is added to tsconfig.build.json so the CLI entries get declarations.
  • junior-memory and junior-plugin-api move from tsup to tsdown. tsup's declaration bundler needs the old API, and unbundled tsc output fails the attw node16 check because these sources use extensionless imports.
  • junior-dashboard keeps tsup for its JavaScript (it has a custom esbuild asset plugin). It uses a dts-only tsdown config for dist/index.d.ts.
  • The tool annotation and error classification scripts import @typescript/typescript6.
  • dependency-cruiser gets @typescript/typescript6 through packageExtensions. Without that it silently cruised 0 modules on TS 7. It now cruises 536 again.
  • packages/docs stays on TS 6 because @astrojs/check does not support TS 7.
  • junior init now scaffolds typescript@^7.0.2. The example app tsconfig is unchanged so it stays aligned with the scaffold.

via @joshuarli.

--

View Junior Session [Sentry]

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 21, 2026 9:26pm UTC

Request Review

@sentry-evals

sentry-evals Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 68 5 1 $0.73 0 679.41s

Base commit b7638c8 has no eval run to compare against.

junior-guardian

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 87 0 0 $0.03 0 28.28s

Base commit b7638c8 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 99 2 0 $0.89 0 396.37s

Base commit b7638c8 has no eval run to compare against.

junior-router

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 12 0 0 $0.00 0 3.95s

Base commit b7638c8 has no eval run to compare against.

@joshuarli
joshuarli marked this pull request as ready for review October 16, 2026 22:34
@github-actions github-actions Bot added the risk: high PR risk score: high label Oct 16, 2026
@joshuarli
joshuarli requested a review from dcramer October 16, 2026 22:49

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ad58914. Configure here.

This branch was successfully deployed

1 active deployment
Preview – junior-docs — ad589142 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant