Skip to content

--useDefineForClassFields should be default in tsc init #43167

Closed

Description

@ljharb

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.

Activity

  1. added
    In Discussion
    Suggestion
    on Mar 9, 2021
  2. DanielRosenwasser commented on Mar 9, 2021

    @DanielRosenwasser
    Member

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

  3. added
    Duplicate
    on Mar 9, 2021
  4. removed
    In Discussion
    Suggestion
    on Mar 9, 2021
  5. typescript-bot commented on Mar 12, 2021

    @typescript-bot
    Contributor

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

  6. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions