Skip to content

Pin composite/declaration in client/tsconfig-reference.json#112243

Merged
paulopmt1 merged 1 commit into
trunkfrom
fix/odyssey-stats-tsconfig-composite
Jul 3, 2026
Merged

Pin composite/declaration in client/tsconfig-reference.json#112243
paulopmt1 merged 1 commit into
trunkfrom
fix/odyssey-stats-tsconfig-composite

Conversation

@paulopmt1

@paulopmt1 paulopmt1 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Task-related: DOTCOM-17552
Addressing this feedback: #112095 (comment)

Proposed Changes

  • Explicitly declare composite, declaration, and declarationMap in client/tsconfig-reference.json instead of relying on them being inherited from client/tsconfig.json.

This is a no-op on trunk today: client/tsconfig.json extends the shared @automattic/calypso-typescript-config (via mixed-package.jsonts-package.json), which already sets all three to true, and the reference config inherits them. This PR just pins those values at the reference config itself.

Why are these changes being made?

client/tsconfig-reference.json extends client/tsconfig.json and is consumed by apps/odyssey-stats/tsconfig.json as a composite project reference (references: [ … { "path": "../../client/tsconfig-reference.json" } ]). A referenced project must have composite: true, otherwise tsc aborts with TS6306: Referenced project must have setting "composite": true.

Today the reference config satisfies this only by inheritance. The upcoming React 19 upgrade (#112095) sets composite: false on the leaf client/tsconfig.json as a declaration-emit workaround, which the reference config would silently inherit — breaking odyssey-stats' type resolution with TS6306.

Decoupling the reference config from the leaf config's composite setting immunizes odyssey-stats against that regression while leaving the React 19 leaf-config workaround (and the real typecheck-client CI gate) untouched.

Testing Instructions

  • tsc --noEmit --project apps/odyssey-stats/tsconfig.json — no TS6306. (odyssey-stats has ~66 pre-existing, unrelated typecheck errors on trunk — untyped .js imports, SCSS side-effect imports, missing pre-built .d.ts — that are not gated by CI and are unchanged by this PR.)
  • yarn typecheck-client still passes.
  • The reference config is used for type resolution only; no tsc --build path emits from it (odyssey-stats builds via calypso-build/webpack), so no declaration-emit output changes.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes?
  • Have you used memoizing on expensive computations?
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label (p4TIVU-aUh-p2)?

🤖 Generated with Claude Code

client/tsconfig-reference.json extends client/tsconfig.json and relies on it
to provide composite/declaration/declarationMap (inherited from the shared
calypso-typescript-config). apps/odyssey-stats references this config as a
composite project, so it requires composite: true.

Re-declare these settings explicitly on the reference config so it no longer
depends on the leaf config keeping them. This is a no-op on trunk (the values
match what is currently inherited) and prevents a TS6306 regression when the
leaf tsconfig sets composite: false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paulopmt1
paulopmt1 marked this pull request as ready for review July 3, 2026 00:05
@paulopmt1
paulopmt1 requested a review from kangzj July 3, 2026 00:33
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 3, 2026
@paulopmt1
paulopmt1 added this pull request to the merge queue Jul 3, 2026
Merged via the queue into trunk with commit 72f6363 Jul 3, 2026
18 checks passed
@paulopmt1
paulopmt1 deleted the fix/odyssey-stats-tsconfig-composite branch July 3, 2026 11:38
@github-actions github-actions Bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 3, 2026
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.

3 participants