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).
There is no shared TypeScript config. Four packages each restate their compiler options from scratch, and they have already drifted apart.
Current drift
strictwebnoUnusedLocals,noUnusedParameters,noFallthroughCasesInSwitch,noUncheckedSideEffectImports,verbatimModuleSyntax: falseworkersforceConsistentCasingInFileNamesonlysharednoUnusedLocals,noUnusedParameters,noImplicitReturns,noFallthroughCasesInSwitch,forceConsistentCasingInFileNamesdbsharedNo package uses
extends. Notable consequences:packages/workersis the weakest-checked package in the repo -- nonoUnusedLocals, nonoUnusedParameters, nonoImplicitReturns, nonoFallthroughCasesInSwitch. That is the backend.noImplicitReturnsis on insharedanddb, off inwebandworkers.noUncheckedIndexedAccessorexactOptionalPropertyTypes.Why now
This is a prerequisite for #774. Turning on
noUncheckedIndexedAccessper 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-enginealready works this way -- onetsconfig.base.jsoncarryingstrict,noUncheckedIndexedAccess,isolatedModules,forceConsistentCasingInFileNames, and each package's own config narrowed to justlib,types, andinclude. That is the target shape, with one difference:cf-sync-engine's base carriesnoEmit, butsharedanddbhere emit declarations (declaration: true,outDir), sonoEmitstays out of the base andweb/workersset it themselves.Done when
tsconfig.base.jsonexists at the repo root with the shared flagsextendit and declare only what is genuinely package-specific (lib,types,paths,include)workersgains the four checks it is missingpnpm typecheckcleanExpect fallout in
workersfrom the newly-applied flags. That fallout is the point of the issue, not a side effect.Effort: 2-3 hours including the
workerscleanup.Part of #778 (TypeScript correctness target state and tracker).