dotCMS / dotCMS/core

[23/44] Enable TS strict mode in new-block-editor

Open
#35,956 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 the new-block-editor project.

  • Internal dependents: 4 · Rollout order: 23 / 44

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

Acceptance Criteria

  • The six strict flags are present in the project's own tsconfig.json:
    forceConsistentCasingInFileNames, strict, noImplicitOverride, noPropertyAccessFromIndexSignature, noImplicitReturns, noFallthroughCasesInSwitch.
  • tsc -p <projectRoot>/tsconfig.lib.json --noEmit reports 0 errors (tsconfig.app.json for apps).
  • tsc -p <projectRoot>/tsconfig.spec.json --noEmit reports 0 errors.
  • All errors resolved with explicit types — no new any.
  • nx run <project>:lint and :test pass, with the test count unchanged.
  • nx affected -t build,lint does not break dependents.
  • The enforcement status is recorded — i.e. whether any CI gate actually verifies the strictness.

⚠️ Four things established earlier in this rollout that make error counts untrustworthy:

  • :test does not type-check. isolatedModules: true puts ts-jest in transpile-only mode (#35948), so passing tests say nothing about types. tsc -p is the acceptance test — but run the tests anyway, since they catch behaviour changes tsc cannot.
  • A files entry pointing at a missing file (TS6053, #35947) or an uninstalled types entry (TS2688, #35944) aborts tsc before semantic checking.
  • tsc does not check templates. Only a build does, and most projects here have no build target (#35970).
  • Check moduleResolution. node10 cannot resolve the @dotcms/* subpath exports, which inflated dot-plugins from 63 real errors to 733 (#35966). Match dot-tags: bundler + module: "preserve".

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 the TypeScript Strict Mode guidance in core-web/CLAUDE.md, then inspect the new-block-editor project's own tsconfig.json, tsconfig.lib.json, and tsconfig.spec.json. Run the specified tsc checks first, resolve reported errors with explicit types, and run the Nx lint, test, and affected build/lint commands. Done means all six flags are present, checks pass with unchanged tests, dependents remain working, and enforcement status is recorded.

Written by the indexing model from the issue text.

Assessment

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