dotCMS / dotCMS/core

[38/44] Enable TS strict mode in edit-ema-ui

Open
#35,971 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team : Maintenance Type : Refactoring
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 edit-ema-ui.

Acceptance Criteria

  • The six strict flags are in the project's own tsconfig.json — not tsconfig.spec.json, not tsconfig.base.json (which stays "strict": false).
  • tsc -p <root>/tsconfig.lib.json --noEmit reports 0 errors.
  • tsc -p <root>/tsconfig.spec.json --noEmit reports 0 errors.
  • No new any, and no non-null assertions left in production code — nullability is handled with guards.
  • nx run <project>:lint back at its baseline.
  • nx run <project>:test unchanged.

[!IMPORTANT]
typescript-strict-plugin / npx tsc-strict / @ts-strict-ignore are not used — that approach was dropped early in the epic. See core-web/CLAUDE.mdTypeScript 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:

  1. nx run <project>:test never type-checks — ts-jest runs transpile-only because every tsconfig.spec.json sets isolatedModules: true.
  2. TS2688 (a types entry that is not installed) aborts before semantic checking.
  3. TS6053 (a files entry pointing at a missing file) aborts the same way.
  4. TS5101 / TS5107 (deprecated baseUrl / moduleResolution: node10) also abort.
  5. tsc -p does not check templates. Only a build does.
  6. Check moduleResolution: node10 cannot 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the edit-ema-ui project's own tsconfig.json, along with its tsconfig.lib.json and tsconfig.spec.json, and review the TypeScript Strict Mode guidance in core-web/CLAUDE.md. Run tsc -p against both project configs with --noEmit, then inspect the reported production nullability issues. Done means strict mode is configured in the project config, both checks report zero errors, lint returns to baseline, and tests remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.