[22/44] Enable TS strict mode in block-editor
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 block-editor project.
- Dependency layer: 6 (0 = leaf library, 10 = top-level app)
- Internal dependents: 5 (
dotcms-block-editor,dotcms-ui,edit-content,edit-ema-ui,portlets-edit-ema-portlet) - Rollout order: 22 / 44
Acceptance Criteria
- The six strict flags are added to
libs/block-editor/tsconfig.json— the project's own config, nottsconfig.spec.jsonand nottsconfig.base.json, which stays"strict": false:
forceConsistentCasingInFileNames,strict,noImplicitOverride,noPropertyAccessFromIndexSignature,noImplicitReturns,noFallthroughCasesInSwitch. -
tsc -p libs/block-editor/tsconfig.lib.json --noEmitreports 0 errors. -
tsc -p libs/block-editor/tsconfig.spec.json --noEmitreports 0 errors — the flags live intsconfig.json, which the spec config extends, so spec errors are in scope. - No new
any. Anything unavoidable uses@ts-expect-errorwith a// TODO(#issue):note, never a blanket@ts-ignore. -
nx run block-editor:lintintroduces no new findings. -
nx run block-editor:testdoes not regress — compared by failing-test name, not just count. - The five dependents gain no new errors.
[!IMPORTANT]
typescript-strict-plugin/npx tsc-strict/@ts-strict-ignoreare not used. Those were dropped early in the epic; the approach in force is documented incore-web/CLAUDE.md→ TypeScript Strict Mode. The original ACs above have been corrected accordingly.
Measurement caveats
Five ways to get a green signal that checked nothing — all of them hit during this epic:
nx run <project>:testnever type-checks.jest-preset-angularruns on ts-jest, which copies TypeScript'sisolatedModulesinto its own transpile-only switch and skips building the language-service host diagnostics need. Passing tests are not evidence that specs compile.TS2688(atypesentry that is not installed) abortstscbefore semantic checking — one error, no type checking at all.TS6053(afilesentry pointing at a missing file) aborts the same way. A non-matchingincludeglob is harmless; a missingfilesentry is fatal.tsc -pdoes not check templates. Only a build does.- Check
moduleResolution.node10cannot resolve the@dotcms/*subpath exports, which inflateddot-pluginsfrom 63 real errors to 733 phantom ones.
block-editor has no build target, so tsc -p on both configs is the acceptance test — there is no build to lean on.
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 and inspect libs/block-editor/tsconfig.json, tsconfig.lib.json, and tsconfig.spec.json. Run tsc -p on both project configs, then check nx run block-editor:lint and nx run block-editor:test, while verifying the five dependent projects gain no errors. Done means all six flags are in the project config, both checks pass without new any, and dependents remain clean.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100