dotCMS / dotCMS/core

[14/44] Enable TS strict mode in sdk-angular

Open
#35,947 3 comments 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 the sdk-angular project.

  • Dependency layer: 2 (0 = leaf library, 10 = top-level app)
  • Internal dependents: 0 project(s)
  • Rollout order: 14 / 44
  • Note: Isolated (0 dependents).

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 in core-web/CLAUDE.mdTypeScript Strict Mode.

Acceptance Criteria

  • The six strict flags are present in sdk-angular's own tsconfig.json (not tsconfig.base.json, not tsconfig.spec.json):
    forceConsistentCasingInFileNames, strict, noImplicitOverride, noPropertyAccessFromIndexSignature, noImplicitReturns, noFallthroughCasesInSwitch.
  • All resulting type errors are resolved (no new any; use explicit types).
  • @ts-expect-error with a // TODO(#35947): note is used only where unavoidable — never a blanket @ts-ignore.
  • tsc -p libs/sdk/angular/tsconfig.lib.json --noEmit reports 0 own errors.
  • tsc -p libs/sdk/angular/tsconfig.spec.json --noEmit reports 0 own errors — and actually completes a semantic pass (see note below).
  • nx run sdk-angular:lint, :test and :build pass.
  • nx affected -t build,lint does not break dependents.
  • The enforcement status is recorded — i.e. whether any CI gate actually verifies the strictness.

⚠️ For this project the spec-config criterion needs care: tsconfig.spec.json listed a files entry for a deleted next/test-setup.ts, so tsc aborted with TS6053 before semantic checking. An error count from that state means nothing. Confirm the compiler reached the code.

Priority

Medium

Additional Context

One project in the bottom-up rollout tracked by epic #35932.

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

Start with core-web/CLAUDE.md's TypeScript Strict Mode guidance and inspect libs/sdk/angular/tsconfig.lib.json and tsconfig.spec.json, including the deleted next/test-setup.ts reference. Run both specified tsc commands and confirm the spec compiler completes semantic checking before fixing errors. Done means the six flags are in the project's own configuration, the listed nx checks and affected build pass, and enforcement status is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
build-system, frontend, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.