Skip to content

Primary constructor editorconfig rule based on target type? #38981

@aventus13

Description

@aventus13

Primary constructors can be controlled by csharp_style_prefer_primary_constructors editorconfig rule. However, this rule would apply to all types. My team uses primary constructors for immutable data bags defined as records and classic constructors for classes. Is there a way to have this rule differentiate between a record and a class type?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions