Skip to content

Require erasable TypeScript syntax#26915

Open
EvanHahn wants to merge 1 commit intomainfrom
claude/great-wing
Open

Require erasable TypeScript syntax#26915
EvanHahn wants to merge 1 commit intomainfrom
claude/great-wing

Conversation

@EvanHahn
Copy link
Contributor

no ref

What? This enables TypeScript's erasableSyntaxOnly option across the codebase. This means we can't use enums, namespaces, or a few other things. This change should have no user impact.

Why? The big reason: Node supports running TypeScript files directly, but only if all the syntax is erasable. This means we can remove build steps in many cases! It has a few other advantages, too: simplifying source maps, restricting some tricky parts of TypeScript, slightly accelerating TypeScript compilation,

This doesn't enable some of the other options that are sometimes recommended in tandem, like verbatimModuleSyntax. Nor does it actually run .ts files with Node. Those are for another day.

@EvanHahn EvanHahn requested a review from 9larsons as a code owner March 23, 2026 16:50
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df592000-7178-4947-ae06-4f4c045340a3

📥 Commits

Reviewing files that changed from the base of the PR and between f184dae and 0747411.

📒 Files selected for processing (19)
  • apps/activitypub/src/api/activitypub.ts
  • apps/activitypub/tsconfig.json
  • apps/admin-x-design-system/tsconfig.json
  • apps/admin-x-framework/src/utils/errors.ts
  • apps/admin-x-framework/tsconfig.json
  • apps/comments-ui/package.json
  • apps/comments-ui/tsconfig.json
  • apps/portal/package.json
  • apps/portal/tsconfig.json
  • apps/posts/tsconfig.json
  • apps/signup-form/package.json
  • apps/signup-form/tsconfig.json
  • apps/stats/tsconfig.json
  • e2e/data-factory/persistence/adapters/knex.ts
  • e2e/helpers/pages/admin/posts/post/post-preview-frames.ts
  • e2e/tsconfig.json
  • ghost/core/core/server/services/activitypub/activity-pub-service.ts
  • ghost/core/core/server/services/identity-tokens/identity-token-service.ts
  • ghost/core/tsconfig.json
✅ Files skipped from review due to trivial changes (13)
  • apps/admin-x-design-system/tsconfig.json
  • apps/admin-x-framework/tsconfig.json
  • apps/comments-ui/tsconfig.json
  • apps/portal/package.json
  • apps/comments-ui/package.json
  • apps/portal/tsconfig.json
  • apps/stats/tsconfig.json
  • e2e/tsconfig.json
  • apps/signup-form/package.json
  • apps/signup-form/tsconfig.json
  • e2e/helpers/pages/admin/posts/post/post-preview-frames.ts
  • e2e/data-factory/persistence/adapters/knex.ts
  • ghost/core/core/server/services/identity-tokens/identity-token-service.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • apps/activitypub/tsconfig.json
  • apps/posts/tsconfig.json
  • ghost/core/tsconfig.json
  • ghost/core/core/server/services/activitypub/activity-pub-service.ts
  • apps/admin-x-framework/src/utils/errors.ts

Walkthrough

This change enables the TypeScript compiler option erasableSyntaxOnly: true across many tsconfig.json files. It replaces several TypeScript constructor parameter-property shorthands with explicit class fields and assignments (including ActivityPubAPI, ActivityPubService, IdentityTokenService, APIError, JSONError, KnexPersistenceAdapter, and test helpers). It also replaces a numeric PostType enum with a const object plus a derived union type, and updates a few package versions.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main objective of the PR: enabling erasable TypeScript syntax across the codebase by adding the erasableSyntaxOnly compiler option.
Description check ✅ Passed The description clearly explains what the change does (enables erasableSyntaxOnly option), why it matters (enables Node to run TypeScript files directly), and provides relevant context and links.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/great-wing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EvanHahn EvanHahn force-pushed the claude/great-wing branch 2 times, most recently from ebd21d5 to f184dae Compare March 23, 2026 16:55
no ref

**What?** This enables [TypeScript's `erasableSyntaxOnly` option][0]
across the codebase. This means we can't use enums, namespaces, or a few
other things. This change should have no user impact.

**Why?** The big reason: [Node supports running TypeScript files
directly][1], but only if all the syntax is erasable. This means we can
remove build steps in many cases! It has a few other advantages, too:
simplifying source maps, restricting some tricky parts of TypeScript,
slightly accelerating TypeScript compilation,

This doesn't enable some of the other options that are sometimes
recommended in tandem, like `verbatimModuleSyntax`. Nor does it actually
run `.ts` files with Node. Those are for another day.

[0]: https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly
[1]: https://nodejs.org/api/typescript.html#type-stripping
@EvanHahn EvanHahn force-pushed the claude/great-wing branch from f184dae to 0747411 Compare March 24, 2026 13:57
@EvanHahn EvanHahn added the ok to merge for me You can merge this on my behalf if you want. label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok to merge for me You can merge this on my behalf if you want.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant