dotCMS / dotCMS/core

[13/44] Enable TS strict mode in sdk-analytics

Open
#35,946 2 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-analytics project.

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

All internal dependencies of sdk-analytics should already be in strict mode before starting (they appear earlier in the rollout order).

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 is not installed anywhere in the repo. The ACs below reflect the approach actually in force, documented in core-web/CLAUDE.mdTypeScript Strict Mode.

Acceptance Criteria

  • The six strict flags are added to sdk-analytics'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(#35946): note is used only where unavoidable — never a blanket @ts-ignore.
  • pnpm exec tsc -p libs/sdk/analytics/tsconfig.lib.json --noEmit reports 0 errors.
  • pnpm exec tsc -p libs/sdk/analytics/tsconfig.spec.json --noEmit reports 0 errors (the spec config extends tsconfig.json, so specs go strict too).
  • nx run sdk-analytics:lint, :test, :build and :build:standalone 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.

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 libs/sdk/analytics/tsconfig.json and review core-web/CLAUDE.md’s TypeScript Strict Mode guidance. Enable the six listed flags, then run the lib and spec tsc commands and the sdk-analytics lint, test, build, and build:standalone targets. Done means all type errors are resolved without new any, affected builds pass, and CI strictness enforcement is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, testing-qa
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.