Closed
Description
Suggestion
Using flags to maintain back compat is fine, but tsc init
should ideally always match "what we would do by default if we didn't care about back compat". Hence, class fields should match the spec and use [[Define]] by default for all new projects.
See #12437 (comment).
🔍 Search Terms
class fields, useDefineForClassFields, tsc init, default
(i didn't search tho because a TS team member asked for a new issue)
✅ Viability Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- [c] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.