[15/44] Enable TS strict mode in data-access
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
Part of the strict-mode rollout epic #35932. Enable TypeScript strict mode for the data-access project.
- Dependency layer: 3 (0 = leaf library, 10 = top-level app)
- Internal dependents: 27 project(s) — the graph reports 27, not the 23 originally stated
- Rollout order: 15 / 44
- Note: Shared services hub - high leverage.
Note: the original acceptance criteria referenced
typescript-strict-plugin,npx tsc-strict, and// @ts-strict-ignore. That approach was dropped by the epic — the plugin was never installed. The ACs below reflect the approach actually in force, documented incore-web/CLAUDE.md→ TypeScript Strict Mode.
⚠️ The six flags are already present in this project's
tsconfig.json— and inert.data-accesshas nobuildtarget, so its own tsconfig is never read, and its 27 dependents compile these sources under their own non-strict configs. 36 lib errors and 47 spec errors sit behind those flags with CI green. The work here is fixing them, not adding flags.
Acceptance Criteria
- The six strict flags are present in
data-access's owntsconfig.json(already true — do not re-add):
forceConsistentCasingInFileNames,strict,noImplicitOverride,noPropertyAccessFromIndexSignature,noImplicitReturns,noFallthroughCasesInSwitch. -
tsc -p libs/data-access/tsconfig.lib.json --noEmitreports 0 errors. -
tsc -p libs/data-access/tsconfig.spec.json --noEmitreports 0 errors. - All errors resolved with explicit types — no new
any. Genuinely nullable declarations are widened rather than silenced. -
@ts-expect-errorwith a// TODO(#35948):note only where unavoidable; never a blanket@ts-ignore. -
nx run data-access:lintand:testpass, with the test count unchanged. - Blast radius verified: the 6 already-strict dependents are counted before and after, with zero new errors. Widening public types in this library can only surface errors there.
- Runtime behaviour of the widened services is guarded by the consumer suites (
dotcms-ui,ui). - The enforcement status is recorded — i.e. whether any CI gate actually verifies the strictness.
⚠️
nx run data-access:testdoes not type-check.tsconfig.spec.jsonsetsisolatedModules: true, which puts ts-jest in transpile-only mode. Passing tests are not evidence of type-cleanliness here;tsc -pis the acceptance test.
Priority
Medium
Additional Context
One project in the bottom-up rollout tracked by epic #35932.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with core-web/CLAUDE.md's TypeScript Strict Mode guidance, then run tsc -p libs/data-access/tsconfig.lib.json --noEmit and tsc -p libs/data-access/tsconfig.spec.json --noEmit to inventory the errors. Resolve the reported library and spec errors without new any, verify nx run data-access:lint and :test, then check the six strict dependents and record the enforcement status.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100