Skip to content

No shared tsconfig base: five packages drift, and workers is the least-checked #779

Description

@InfinityBowman

There is no shared TypeScript config. Four packages each restate their compiler options from scratch, and they have already drifted apart.

Current drift

Package Flags set beyond strict
web noUnusedLocals, noUnusedParameters, noFallthroughCasesInSwitch, noUncheckedSideEffectImports, verbatimModuleSyntax: false
workers forceConsistentCasingInFileNames only
shared noUnusedLocals, noUnusedParameters, noImplicitReturns, noFallthroughCasesInSwitch, forceConsistentCasingInFileNames
db same as shared

No package uses extends. Notable consequences:

  • packages/workers is the weakest-checked package in the repo -- no noUnusedLocals, no noUnusedParameters, no noImplicitReturns, no noFallthroughCasesInSwitch. That is the backend.
  • noImplicitReturns is on in shared and db, off in web and workers.
  • Nothing has noUncheckedIndexedAccess or exactOptionalPropertyTypes.

Why now

This is a prerequisite for #774. Turning on noUncheckedIndexedAccess per package means editing four files that will drift again; doing it once in a base that all four extend is the same work with a durable result.

cf-sync-engine already works this way -- one tsconfig.base.json carrying strict, noUncheckedIndexedAccess, isolatedModules, forceConsistentCasingInFileNames, and each package's own config narrowed to just lib, types, and include. That is the target shape, with one difference: cf-sync-engine's base carries noEmit, but shared and db here emit declarations (declaration: true, outDir), so noEmit stays out of the base and web / workers set it themselves.

Done when

  • tsconfig.base.json exists at the repo root with the shared flags
  • All four packages extend it and declare only what is genuinely package-specific (lib, types, paths, include)
  • The union of today's flags is applied everywhere, so workers gains the four checks it is missing
  • pnpm typecheck clean

Expect fallout in workers from the newly-applied flags. That fallout is the point of the issue, not a side effect.

Effort: 2-3 hours including the workers cleanup.


Part of #778 (TypeScript correctness target state and tracker).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtInternal quality work with no direct user-facing story

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions