Skip to content

feat: enable erasableSyntaxOnly in TypeScript configs#440

Merged
Patrick Lafrance (patricklafrance) merged 2 commits into
mainfrom
feature/erasable-syntax-only
Jun 11, 2026
Merged

feat: enable erasableSyntaxOnly in TypeScript configs#440
Patrick Lafrance (patricklafrance) merged 2 commits into
mainfrom
feature/erasable-syntax-only

Conversation

@patricklafrance

Copy link
Copy Markdown
Member

What

Adds "erasableSyntaxOnly": true to packages/typescript-configs/core.json — all variants (react, library, web-application, monorepo-workspace) inherit it.

Why

Bans TypeScript syntax that compiles to runtime code: enum, constructor parameter properties, value namespaces, import = aliases. Keeps consumers compatible with type-stripping runtimes (Node --experimental-strip-types) and erasure-only toolchains, and removes a class of TS-only runtime semantics. Already the working convention in wl-app — this gives it compiler enforcement org-wide.

Breaking change

Consumers using enum / parameter properties / value namespaces / import = will get type errors on upgrade — hence the major changeset (happy to downgrade to minor if you'd rather treat it as a lint-tightening). Opt-out is one line in the consumer's tsconfig.json: "erasableSyntaxOnly": false.

Verification

  • Flag requires TS ≥ 5.8; this package's peer range is typescript ^6.0.3 — no peer bump needed.
  • Validated against the wl-app monorepo: 32/32 workspaces typecheck cleanly (tsgo) with the flag enabled.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 11, 2026 21:06
@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@workleap/browserslist-config

pnpm add https://pkg.pr.new/@workleap/browserslist-config@440

@workleap/eslint-configs

pnpm add https://pkg.pr.new/@workleap/eslint-configs@440

@workleap/postcss-configs

pnpm add https://pkg.pr.new/@workleap/postcss-configs@440

@workleap/rsbuild-configs

pnpm add https://pkg.pr.new/@workleap/rsbuild-configs@440

@workleap/rslib-configs

pnpm add https://pkg.pr.new/@workleap/rslib-configs@440

@workleap/stylelint-configs

pnpm add https://pkg.pr.new/@workleap/stylelint-configs@440

@workleap/swc-configs

pnpm add https://pkg.pr.new/@workleap/swc-configs@440

@workleap/tsup-configs

pnpm add https://pkg.pr.new/@workleap/tsup-configs@440

@workleap/typescript-configs

pnpm add https://pkg.pr.new/@workleap/typescript-configs@440

@workleap/webpack-configs

pnpm add https://pkg.pr.new/@workleap/webpack-configs@440

commit: 585c113

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the shared TypeScript base config to enforce “erasure-only” TypeScript syntax by enabling erasableSyntaxOnly, ensuring consumers remain compatible with type-stripping runtimes/toolchains and preventing TS constructs that introduce runtime semantics.

Changes:

  • Enable "erasableSyntaxOnly": true in the core TypeScript config so all derived configs inherit it.
  • Add a major changeset documenting the breaking nature of the new enforcement and opt-out guidance.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/typescript-configs/core.json Enables erasableSyntaxOnly in the shared base compilerOptions, affecting all extended configs.
.changeset/brave-tigers-erase.md Declares a major bump and documents the breaking behavior + migration/opt-out instructions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…taxOnly

Both packages intentionally use `export =` because browserslist and Stylelint
load configs via require() and need `module.exports` to be the config object
itself. Also refreshes the stale comments blaming esbuild output (these
packages build with tsc now).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@patricklafrance Patrick Lafrance (patricklafrance) merged commit d31398f into main Jun 11, 2026
7 checks passed
@patricklafrance Patrick Lafrance (patricklafrance) deleted the feature/erasable-syntax-only branch June 11, 2026 21:47
@github-actions github-actions Bot mentioned this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants