Repository navigation
Conversation
myabc
added this pull request to stack #138
October 7, 2026 18:40
myabc
marked this pull request as ready for review
October 7, 2026 18:44
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No confirmed blocking issues remain in this tooling-only change; source conversion is deferred to subsequent PRs.
0 open findings
What changed in this PR
Adds tooling for the staged TypeScript migration of the CommonMark CKEditor build, without converting runtime source files.
Changes:
- Enables strict TypeScript checking and declares browser globals and SVG imports.
- Adds TypeScript support to webpack, Jest, and ESLint.
- Adds dependencies, documentation, and a CI typecheck step.
| File | Description |
|---|---|
| webpack.config.js | Resolves and transpiles TypeScript modules. |
| tsconfig.json | Enables strict checking while leaving JavaScript unchecked. |
| src/types.d.ts | Declares OpenProject globals and SVG modules. |
| README.md | Documents the typechecking workflow. |
| package.json | Adds tooling dependencies and typecheck command. |
| package-lock.json | Locks updated tooling dependencies. |
| jest.config.js | Enables TypeScript test transformation. |
| eslint.config.mjs | Adds TypeScript lint rules. |
| babel.config.js | Configures TypeScript transpilation for tests. |
| .github/workflows/ci.yml | Runs typechecking in CI. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replaces the unusable tsconfig (DOM lib only, no include) with a strict one and adds a typecheck script. JavaScript stays importable but unchecked, so a file opts in to checking by being renamed to .ts. Declares the window globals that OpenProject core provides and the string modules that raw-loader produces for SVG imports. TypeScript is pinned to 5.9 because typescript-eslint does not support newer majors yet. https://community.openproject.org/wp/OP-18993
Adds ts-loader in transpile-only mode, so bundling strips types without checking them; checking stays in the typecheck script. Jest gets the Babel TypeScript preset, configured to match tsc: imports survive unless written as type imports, and declare fields emit nothing. No source file is converted yet, so the bundle is unchanged. https://community.openproject.org/wp/OP-18993
Adds typescript-eslint for .ts files under src and tests. It bans explicit any, @ts-ignore and @ts-nocheck, and requires a description on @ts-expect-error, so every escape from the type system carries a reason. Rules that would demand edits to runtime code (prefer-const and the like) are off for now: the conversion changes types only. https://community.openproject.org/wp/OP-18993
myabc
force-pushed
the
code-maintenance/OP-18993-typescript-tooling
branch
from
October 7, 2026 19:14
d226c99 to
b1543ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
https://community.openproject.org/wp/OP-18993
What are you trying to accomplish?
First of three PRs that convert this repository to strict TypeScript. This one adds the tooling and converts no source file, so the bundle is byte-identical to
master.After this PR a file opts in to type checking by being renamed from
.jsto.ts..tsfiles are checked in strict mode;.jsfiles stay importable and unchecked.Unlike #109 and #110, the conversion lands in reviewable steps: tooling here, then non-plugin code, then plugins and entry files.
What approach did you choose and why?
tsconfig.json: replaces the existing file, which was unusable (DOM lib only, noinclude). Strict,noEmit,allowJswithoutcheckJs,target: ES2022so class fields keep emitting natively, andverbatimModuleSyntaxso an import is only dropped when written asimport type.src/types.d.ts: declareswindow.I18nandwindow.OpenProject, and the string modulesraw-loaderproduces for*.svg.ts-loaderwithtranspileOnly. Bundling strips types; checking stays innpm run typecheck.@babel/preset-typescript, configured to matchtsc(onlyRemoveTypeImports,allowDeclareFields).typescript-eslintfor.tsfiles. Bansany,@ts-ignoreand@ts-nocheck;@ts-expect-errorneeds a description. Rules that would force runtime edits (prefer-constand similar) are off, because the conversion PRs change types only.npm run typecheck.Version pins, each forced by a peer:
typescript@~5.9(typescript-eslintsupports<6.1, npmlatestis 7.x),@babel/preset-typescript@^7(repo is on Babel 7),@types/jest@^29(repo is on Jest 29).Verification
npm run typechecknpm testmaster)npm run lintnpm run buildmasterckeditor.jsbyte-identical (cmp, sha256fb9a98c31f92406e…on both)Each new gate was also checked to fail when it should, using a temporary canary file: a type error fails
typecheck;@ts-ignoreandanyfaillint; a.tsmodule imports and runs under jest and bundles under webpack.AI involvement
Directed: written by Claude Code from a design agreed with @myabc, then reviewed adversarially by Codex (no findings).