Repository navigation
ref(tsconfig): Apply base (higher) strictness to mcp-core - #2240
Closed
JoshuaKGoldberg wants to merge 2 commits into
Closed
JoshuaKGoldberg wants to merge 2 commits into
JoshuaKGoldberg wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit de6ec23. Configure here.
Member
|
Superseded by #2266. All of this branch's changes are carried there, rebased onto the base branch. |
joshuarli
added a commit
that referenced
this pull request
Nov 18, 2026
Toolkit was on TypeScript 5.9 and pnpm 11, each project had its own type-check settings, and many tests, scripts, Worker and build configs were never type-checked in CI. This moves the workspace to TypeScript 7.0.2 and pnpm 12.18.0, applies one strict tsconfig policy to every maintained TypeScript file, and adds stronger type-aware Oxlint rules. Published package contracts are unchanged. This single PR supersedes the stacked #2240, #2187, #2238, and #2239: everything those branches carried is here, rebased onto current `main` (which also carries #2186). #2187's metric alert query filter fix is included as a cherry-pick. It follows that stack's layout: one root `tsconfig.base.json` that every project extends, no `@sentry/mcp-server-tsconfig` package, and one root `.oxlintrc.json`. Intermediate commits are not individually green; squash-merge. ## Changes - The root `tsconfig.base.json` keeps the stack's runtime defaults and adds the rest of the checking policy. Projects set only runtime options such as target, module, lib, types, JSX and emit. The policy enables: - `strict`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `noPropertyAccessFromIndexSignature` - `verbatimModuleSyntax`, `erasableSyntaxOnly` - the `noUnused*` checks - `skipLibCheck: false` - Every package's sources, tests, scripts and build configs belong to a program that its `typecheck` script runs. - `scripts/tsconfig-policy.test.mjs` reads the policy from the root base and guards against: - files left uncovered - weakened options - library-check exceptions without a stated reason - Tooling upgrades: - Oxlint 1.93 with tsrs-lint (tsrs 7.1.0-beta.tsrs3) for type-aware rules, Oxfmt 0.78, tsdown 0.23 - Code generators that need the old compiler API now use `@typescript/typescript6`. - New lint rules for the whole repo: promise misuse, exhaustive switches, `only-throw-error` and related safety rules. - Non-test code outside the CLI, including apps/local, now also bans `any`, `!`, unnecessary conditions and unsafe `any` flows. - Bugs that stricter types exposed: - mcp-cloudflare now rejects incomplete OAuth approval states and empty HMAC signatures. - mcp-cloudflare's `/api/chat` now returns a 500 for a non-`Error` throw. - apps/local's Web Vitals view no longer crashes when a page has no metrics. - The CLI's `command-api.json` regained the fixed query notes it had lost. ## Impact - pnpm 11 switches itself to 12.18.0 because of the `packageManager` pin. The first switch adds `@pnpm/exe` entries to `pnpm-lock.yaml`; discard them. - `typecheck` is the canonical script. `tsc` remains as an alias. - The quality job in CI builds `@sentry/mcp-core` and `@sentry/logger` before lint, because type-aware rules read workspace packages through their built declarations. ## Exceptions - `packages/codemod-cli3to4/tsconfig.json` repeats the checking options instead of extending the root, because `jssg` cannot resolve an `extends` outside the package. The policy test fails if the copy drifts. - 11 programs keep `skipLibCheck: true`, each with a comment naming the dependency, the diagnostic and when to remove it: - `ai` declarations (under `exactOptionalPropertyTypes`, and DOM or Node names they reference) - `@cloudflare/workers-types` conflicting with `@types/node` globals, and `urlpattern-polyfill` against the workers-types `URLPattern` global - `wrangler` and `miniflare` declarations referencing packages they bundle but do not ship - `unplugin` and `vite` declarations referencing packages they don't ship - `hono` declarations using DOM names in the Node program - `apps/cli-docs` keeps `astro check` on TypeScript 6 until `@astrojs/check` supports TypeScript 7. - Vitest is pinned to `~5.0.5`. Vitest 5.1 needs `AsyncLocalStorage.disable()`, which workerd lacks. Remove the pin once `@cloudflare/vitest-plugin` ≥ 1.7.0 is adopted. - Type-aware lint runs on `tsrs-lint`, which tracks the TypeScript 7.1 beta. `pnpm run typecheck` stays on TypeScript 7.0 and is the type gate. `.pnpmfile.cjs` drops oxlint's optional `oxlint-tsgolint` peer, which pnpm 12 would otherwise install unused. tsrs3 is newer than the release-age window, so its packages are in `minimumReleaseAgeExclude`. ## Open questions - In mcp-cloudflare's `chat-message.tsx`, the tool-part state mapping never sees `"result"` under AI SDK v6. That bug predates this PR and is left as is. Refs getsentry/junior#2171 <!-- junior-request-attribution:start --> via @joshuarli. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:local%3Aweb%3Af90a6d1952c6435371ab2bce --> -- [View Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3Af90a6d1952c6435371ab2bce) [[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Af90a6d1952c6435371ab2bce/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: Josh Goldberg ✨ <joshua.goldberg@sentry.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Joshua Li <14209781+joshuarli@users.noreply.github.com> Co-authored-by: Joshua Li <joshuarli98@gmail.com> Co-authored-by: Inkling 2 Small Free <inkling-2-small-free@users.noreply.github.com>
This branch was successfully deployed
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.
Removes
mcp-core'snoUncheckedIndexedAccessoverride, so every package now type-checks with the shared base's full strictness. Handles the possibly-missing indexes it surfaces.