Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--useDefineForClassFields should be default in tsc init #43167

Closed
4 tasks done
ljharb opened this issue Mar 9, 2021 · 2 comments
Closed
4 tasks done

--useDefineForClassFields should be default in tsc init #43167

ljharb opened this issue Mar 9, 2021 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@ljharb
Copy link
Contributor

ljharb commented Mar 9, 2021

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.
@RyanCavanaugh RyanCavanaugh added In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Mar 9, 2021
@RyanCavanaugh RyanCavanaugh self-assigned this Mar 9, 2021
@DanielRosenwasser
Copy link
Member

Duplicate of #39311? (Discussed briefly at #40636)

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 9, 2021
@RyanCavanaugh RyanCavanaugh removed their assignment Mar 9, 2021
@RyanCavanaugh RyanCavanaugh removed In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Mar 9, 2021
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants