[41/44] Enable TS strict mode in edit-content
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 edit-content project.
- Dependency layer: 8 (0 = leaf library, 10 = top-level app)
- Internal dependents: 3 project(s)
- Rollout order: 41 / 44
The original acceptance criteria were stale. They described a
typescript-strict-plugin/
npx tsc-strict/@ts-strict-ignoreapproach that was dropped early in the epic. The approach
actually in force is documented incore-web/CLAUDE.md→ TypeScript Strict Mode:
the six flags go in the project's owntsconfig.json, andtsconfig.base.jsonstays
"strict": false. The criteria below have been rewritten to match.
Acceptance Criteria
- The six flags are in
libs/edit-content/tsconfig.json— not intsconfig.spec.json, not in the base:
forceConsistentCasingInFileNames,strict,noImplicitOverride,
noPropertyAccessFromIndexSignature,noImplicitReturns,noFallthroughCasesInSwitch. -
tsconfig.spec.jsondoes not override them. This project had explicit
"strict": falseand"noPropertyAccessFromIndexSignature": falseopt-outs, which hid
666 of the 944 errors the specs really had. -
pnpm exec tsc -p libs/edit-content/tsconfig.lib.json --noEmit→ 0 (was 101 own). -
pnpm exec tsc -p libs/edit-content/tsconfig.spec.json --noEmit→ 0 (was 208 own). - No new
any. Every remaining cast isas unknown as Tat a fixture that is deliberately
out of contract, each with a comment saying why. - No production non-null assertions added —
@typescript-eslint/no-non-null-assertionis a
warning in production code and off only for*.spec.ts. -
nx run edit-content:lint— 0 errors, 11 warnings, identical to the pre-existing baseline. -
nx run edit-content:test— 112 suites / 2218 passing, unchanged. -
nx affected -t build— all 7 affected projects build. - Blast radius: 0 errors across all 12 strict projects after every shared-model change.
Measurement caveats that apply to this project
These cost real time on this epic; all six are now in core-web/CLAUDE.md.
nx run <project>:testnever type-checks.ts-jestcopies TypeScript'sisolatedModules
into its own transpile-only switch, so passing tests are never evidence that specs compile.TS2688(atypesentry that is not installed) aborts before semantic checking.TS6053(afilesentry pointing at a missing file) aborts likewise.TS5101/TS5107(deprecatedbaseUrl,moduleResolution: node10) abort likewise.tsc -pdoes not check templates — only a build does.moduleResolution: node10cannot resolve@dotcms/*subpath exports.
General rule: any TS5xxx, TS6xxx or TS2688 error is a configuration error. tsc never
reached the code, so the count after it means nothing. Read the first error before trusting the
last number.
Two more specific to this project
libs/edit-contenthas nobuildtarget — onlytest. Its templates have therefore never
been type-checked, so thestrictTemplatesin itsangularCompilerOptionsis declared but inert.
Same gap aslibs/block-editor. Raised on the epic.tsconfig.lib.jsondid not exclude test fixtures.mocks.tsfiles that import
@dotcms/utils-testingwere compiled as production withtypes: [], producing 27
Cannot find name 'jest'errors that had nothing to do with this library's sources. Identical
defect totemplate-builder(#35958). Note thatexcludeonly drops them as root files — it
does not stoptscpulling a file in when something imports it, which is exactly what makes the
change safe: no production file imports any of those fixtures.
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
Read core-web/CLAUDE.md's TypeScript Strict Mode guidance, then inspect libs/edit-content/tsconfig.json, tsconfig.spec.json, and tsconfig.lib.json. Run the two tsc commands first; the work is complete when both report zero errors, lint and tests match their stated baselines, and the affected projects build without blast-radius errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100