Skip to content

EditorConfig template should contain all rules #4393

Open

Description

The file created by dotnet new editorconfig (source) does not contain all available rules. Compared with an EditorConfig file exported by Visual Studio 2022 (via Tools - Options - Text Editor - C# - Code Style - Generate .editorconfig file from settings) it is missing some rules.

As of SDK version 7.0.302 the .editorconfig template is missing the following rules:

dotnet_style_namespace_match_folder
dotnet_style_prefer_foreach_explicit_cast_in_source

csharp_style_implicit_object_creation_when_type_is_apparent
csharp_style_namespace_declarations
csharp_style_prefer_extended_property_pattern
csharp_style_prefer_local_over_anonymous_function
csharp_style_prefer_method_group_conversion
csharp_style_prefer_null_check_over_type_check
csharp_style_prefer_readonly_struct
csharp_style_prefer_readonly_struct_member
csharp_style_prefer_top_level_statements
csharp_style_prefer_tuple_swap
csharp_style_prefer_utf8_string_literals

dotnet_style_allow_multiple_blank_lines_experimental
dotnet_style_allow_statement_immediately_after_block_experimental
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental
csharp_style_allow_blank_lines_between_consecutive_braces_experimental
csharp_style_allow_embedded_statements_on_same_line_experimental
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental

Also see dotnet/roslyn#60539 for the experimental rules.

Additionally, the .editorconfig template contains the rule csharp_style_pattern_local_over_anonymous_function. This rule doesn't exist any more. It is the old name of the rule csharp_style_prefer_local_over_anonymous_function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    featureThe issue defines new feature.triagedThe issue was evaluated by the triage team, placed on correct area, next action defined.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions