feat: enable erasableSyntaxOnly in TypeScript configs#440
Merged
Patrick Lafrance (patricklafrance) merged 2 commits intoJun 11, 2026
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot started reviewing on behalf of
Patrick Lafrance (patricklafrance)
June 11, 2026 21:06
View session
@workleap/browserslist-config
@workleap/eslint-configs
@workleap/postcss-configs
@workleap/rsbuild-configs
@workleap/rslib-configs
@workleap/stylelint-configs
@workleap/swc-configs
@workleap/tsup-configs
@workleap/typescript-configs
@workleap/webpack-configs
commit: |
Contributor
There was a problem hiding this comment.
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": truein 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>
Merged
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.
What
Adds
"erasableSyntaxOnly": truetopackages/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, valuenamespaces,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'stsconfig.json:"erasableSyntaxOnly": false.Verification
typescript ^6.0.3— no peer bump needed.tsgo) with the flag enabled.🤖 Generated with Claude Code