[25/44] Enable TS strict mode in template-builder
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 template-builder.
Acceptance Criteria
- The six strict flags are in the project's own
tsconfig.json— nottsconfig.spec.json, nottsconfig.base.json(which stays"strict": false). -
tsc -p <root>/tsconfig.lib.json --noEmitreports 0 errors. -
tsc -p <root>/tsconfig.spec.json --noEmitreports 0 errors. - No new
any, and no non-null assertions left in production code — nullability is handled with guards. -
nx run <project>:lintback at its baseline. -
nx run <project>:testunchanged.
[!IMPORTANT]
typescript-strict-plugin/npx tsc-strict/@ts-strict-ignoreare not used — that approach was dropped early in the epic. Seecore-web/CLAUDE.md→ TypeScript Strict Mode. The original ACs have been corrected.
Measurement caveats
Six ways to get a green signal that verified nothing, all hit during this epic:
nx run <project>:testnever type-checks — ts-jest runs transpile-only because everytsconfig.spec.jsonsetsisolatedModules: true.TS2688(atypesentry that is not installed) aborts before semantic checking.TS6053(afilesentry pointing at a missing file) aborts the same way.TS5101/TS5107(deprecatedbaseUrl/moduleResolution: node10) also abort.tsc -pdoes not check templates. Only a build does.- Check
moduleResolution:node10cannot resolve the@dotcms/*subpath exports.
The rule: any TS5xxx, TS6xxx or TS2688 error is a configuration error — tsc never reached the code, so the count after it is meaningless.
Neither project has a build target, so tsc -p on both configs is the acceptance test.
Priority
Medium
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 and inspect template-builder's own tsconfig.json alongside tsconfig.lib.json and tsconfig.spec.json. Run tsc -p /tsconfig.lib.json --noEmit and tsc -p /tsconfig.spec.json --noEmit, then check the project's lint and test targets. Done means both type checks have zero errors, strict flags are project-local, production code has no new any or non-null assertions, and lint and tests remain at baseline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100