11# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2- # ##############################
3- # Core EditorConfig Options #
4- # ##############################
5- # All files
6- [* ]
2+ # ##############################
3+ # Core EditorConfig Options #
4+ # ##############################
5+ # All files
6+ [* ]
77indent_style = space
8- # Code files
8+ # Code files
99[* .{cs,csx,vb,vbx} ]
1010indent_size = 4
1111insert_final_newline = true
1212charset = utf-8-bom
13- # ##############################
14- # .NET Coding Conventions #
15- # ##############################
13+ # ##############################
14+ # .NET Coding Conventions #
15+ # ##############################
1616[* .{cs,vb} ]
1717# Organize usings
1818dotnet_sort_system_directives_first = true :suggestion
@@ -21,74 +21,96 @@ dotnet_style_qualification_for_field = false:silent
2121dotnet_style_qualification_for_property = false :silent
2222dotnet_style_qualification_for_method = false :silent
2323dotnet_style_qualification_for_event = false :silent
24- # Language keywords vs BCL types preferences
24+ # Language keywords vs BCL types preferences
2525dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
2626dotnet_style_predefined_type_for_member_access = false :suggestion
27- # Parentheses preferences
27+ # Parentheses preferences
2828dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
2929dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
3030dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
3131dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
32- # Modifier preferences
32+ # Modifier preferences
3333dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
3434dotnet_style_readonly_field = true :suggestion
35- # Expression-level preferences
35+ # Expression-level preferences
3636dotnet_style_object_initializer = true :suggestion
37- dotnet_style_collection_initializer = true :suggestion
38- dotnet_style_explicit_tuple_names = true :suggestion
39- dotnet_style_null_propagation = true :suggestion
37+ dotnet_style_collection_initializer = true :warning
38+ dotnet_style_explicit_tuple_names = true :error
39+ dotnet_style_null_propagation = true :error
4040dotnet_style_coalesce_expression = true :suggestion
41- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :silent
41+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
4242dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
4343dotnet_style_prefer_inferred_tuple_names = true :suggestion
44- dotnet_style_prefer_auto_properties = true :silent
45- dotnet_style_prefer_conditional_expression_over_assignment = true :silent
46- dotnet_style_prefer_conditional_expression_over_return = true :silent
47- # ##############################
48- # C# Coding Conventions #
49- # ##############################
44+ dotnet_style_prefer_auto_properties = true :suggestion
45+ dotnet_style_prefer_conditional_expression_over_assignment = true :suggestion
46+ dotnet_style_prefer_conditional_expression_over_return = true :suggestion
47+ dotnet_style_operator_placement_when_wrapping = beginning_of_line:suggestion
48+ dotnet_style_prefer_compound_assignment = true :error
49+ dotnet_style_prefer_simplified_boolean_expressions = true :warning
50+ dotnet_style_prefer_simplified_interpolation = true :warning
51+ dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed:silent
52+ dotnet_style_prefer_collection_expression = true :suggestion
53+ # ##############################
54+ # C# Coding Conventions #
55+ # ##############################
5056[* .cs ]
51- # var preferences
52- csharp_style_var_for_built_in_types = true :silent
53- csharp_style_var_when_type_is_apparent = true :silent
54- csharp_style_var_elsewhere = false :silent
55- # Expression-bodied members
56- csharp_style_expression_bodied_methods = false :silent
57+ # var preferences
58+ csharp_style_var_elsewhere = true :suggestion
59+ csharp_style_var_for_built_in_types = true :warning
60+ csharp_style_var_when_type_is_apparent = true :warning
61+ csharp_style_prefer_tuple_swap = true :suggestion
62+ # Expression-bodied members
63+ csharp_style_expression_bodied_methods = true :suggestion
5764csharp_style_expression_bodied_constructors = false :silent
5865csharp_style_expression_bodied_operators = false :silent
59- csharp_style_expression_bodied_properties = true :silent
66+ csharp_style_expression_bodied_properties = true :suggestion
6067csharp_style_expression_bodied_indexers = true :silent
61- csharp_style_expression_bodied_accessors = true :silent
62- # Pattern matching preferences
68+ csharp_style_expression_bodied_accessors = true :suggestion
69+ csharp_style_expression_bodied_lambdas = true :silent
70+ csharp_style_expression_bodied_local_functions = false :silent
71+ # Expression-level preferences
72+ csharp_prefer_simple_default_expression = true :error
73+ csharp_style_deconstructed_variable_declaration = true :silent
74+ csharp_style_inlined_variable_declaration = true :warning
75+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
76+ csharp_style_prefer_index_operator = true :warning
77+ csharp_style_prefer_range_operator = true :suggestion
78+ csharp_style_throw_expression = true :warning
79+ csharp_style_unused_value_assignment_preference = discard_variable:error
80+ csharp_style_unused_value_expression_statement_preference = discard_variable:silent
81+ csharp_style_prefer_utf8_string_literals = true :suggestion
82+ csharp_style_prefer_readonly_struct = true :suggestion
83+ csharp_style_prefer_readonly_struct_member = true :suggestion
84+ # Pattern matching preferences
6385csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
6486csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
65- # Null-checking preferences
87+ # Null-checking preferences
6688csharp_style_throw_expression = true :suggestion
6789csharp_style_conditional_delegate_call = true :suggestion
68- # Modifier preferences
90+ # Modifier preferences
6991csharp_preferred_modifier_order = public,internal,protected,private,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
70- # Expression-level preferences
92+ # Expression-level preferences
7193csharp_prefer_braces = true :silent
7294csharp_style_deconstructed_variable_declaration = true :suggestion
7395csharp_prefer_simple_default_expression = true :suggestion
7496csharp_style_pattern_local_over_anonymous_function = true :suggestion
7597csharp_style_inlined_variable_declaration = true :suggestion
76- # ##############################
77- # C# Formatting Rules #
78- # ##############################
79- # New line preferences
98+ # ##############################
99+ # C# Formatting Rules #
100+ # ##############################
101+ # New line preferences
80102csharp_new_line_before_open_brace = all
81103csharp_new_line_before_else = true
82104csharp_new_line_before_catch = true
83105csharp_new_line_before_finally = true
84106csharp_new_line_before_members_in_object_initializers = true
85107csharp_new_line_before_members_in_anonymous_types = true
86108csharp_new_line_between_query_expression_clauses = true
87- # Indentation preferences
109+ # Indentation preferences
88110csharp_indent_case_contents = true
89111csharp_indent_switch_labels = true
90112csharp_indent_labels = flush_left
91- # Space preferences
113+ # Space preferences
92114csharp_space_after_cast = false
93115csharp_space_after_keywords_in_control_flow_statements = true
94116csharp_space_between_method_call_parameter_list_parentheses = false
@@ -100,60 +122,60 @@ csharp_space_around_binary_operators = before_and_after
100122csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
101123csharp_space_between_method_call_name_and_opening_parenthesis = false
102124csharp_space_between_method_call_empty_parameter_list_parentheses = false
103- # Wrapping preferences
125+ # Wrapping preferences
104126csharp_preserve_single_line_statements = false
105127csharp_preserve_single_line_blocks = true
106- # ##############################
107- # Naming Conventions #
108- # ##############################
109- # Style Definitions
128+ # ##############################
129+ # Naming Conventions #
130+ # ##############################
131+ # Style Definitions
110132dotnet_naming_style.pascal_case_style.capitalization = pascal_case
111133dotnet_naming_style.camel_case_style.capitalization = camel_case
112134dotnet_naming_style.underscore_prefix_style.capitalization = camel_case
113135dotnet_naming_style.underscore_prefix_style.required_prefix = _
114136dotnet_naming_style.interface_prefix_style.capitalization = pascal_case
115137dotnet_naming_style.interface_prefix_style.required_prefix = I
116138# Use PascalCase for types
117- dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
118- dotnet_naming_rule.types_should_be_pascal_case.symbols = types
119- dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case_style
139+ dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
140+ dotnet_naming_rule.types_should_be_pascal_case.symbols = types
141+ dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case_style
120142dotnet_naming_symbols.types.applicable_kinds = class,struct,enum
121- dotnet_naming_symbols.types.applicable_accessibilities = *
143+ dotnet_naming_symbols.types.applicable_accessibilities = *
122144# Use camelCase for parameters and local variables
123- dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
124- dotnet_naming_rule.locals_should_be_camel_case.symbols = locals
125- dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
145+ dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
146+ dotnet_naming_rule.locals_should_be_camel_case.symbols = locals
147+ dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
126148dotnet_naming_symbols.locals.applicable_kinds = parameter
127- # Use PascalCase for constant fields
128- dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
149+ # Use PascalCase for constant fields
150+ dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
129151dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
130- dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
131- dotnet_naming_symbols.constant_fields.applicable_kinds = field
132- dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
152+ dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
153+ dotnet_naming_symbols.constant_fields.applicable_kinds = field
154+ dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
133155dotnet_naming_symbols.constant_fields.required_modifiers = const
134- # Use PascalCase for readonly static fields
135- dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.severity = suggestion
156+ # Use PascalCase for readonly static fields
157+ dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.severity = suggestion
136158dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.symbols = static_readonly_fields
137- dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.style = pascal_case_style
138- dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
139- dotnet_naming_symbols.static_readonly_fields.applicable_accessibilities = *
159+ dotnet_naming_rule.static_readonly_fields_should_be_pascal_case.style = pascal_case_style
160+ dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
161+ dotnet_naming_symbols.static_readonly_fields.applicable_accessibilities = *
140162dotnet_naming_symbols.static_readonly_fields.required_modifiers = static,readonly
141163# Use underscore prefix and camel case for (non-constant) fields
142- dotnet_naming_rule.fields_should_be_prefixed_underscore.severity = suggestion
143- dotnet_naming_rule.fields_should_be_prefixed_underscore.symbols = fields
144- dotnet_naming_rule.fields_should_be_prefixed_underscore.style = underscore_prefix_style
145- dotnet_naming_symbols.fields.applicable_kinds = field
164+ dotnet_naming_rule.fields_should_be_prefixed_underscore.severity = suggestion
165+ dotnet_naming_rule.fields_should_be_prefixed_underscore.symbols = fields
166+ dotnet_naming_rule.fields_should_be_prefixed_underscore.style = underscore_prefix_style
167+ dotnet_naming_symbols.fields.applicable_kinds = field
146168dotnet_naming_symbols.fields.applicable_accessibilities = *
147169# Use PascalCase for all members except fields
148- dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
149- dotnet_naming_rule.members_should_be_pascal_case.symbols = members
150- dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
170+ dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
171+ dotnet_naming_rule.members_should_be_pascal_case.symbols = members
172+ dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
151173dotnet_naming_symbols.members.applicable_kinds = property,method,event,delegate
152174dotnet_naming_symbols.members.applicable_accessibilities = *
153175# Use PascalCase and I prefix for interfaces
154- dotnet_naming_rule.interfaces_should_be_prefixed_with_I.severity = suggestion
155- dotnet_naming_rule.interfaces_should_be_prefixed_with_I.symbols = interfaces
156- dotnet_naming_rule.interfaces_should_be_prefixed_with_I.style = interface_prefix_style
176+ dotnet_naming_rule.interfaces_should_be_prefixed_with_I.severity = suggestion
177+ dotnet_naming_rule.interfaces_should_be_prefixed_with_I.symbols = interfaces
178+ dotnet_naming_rule.interfaces_should_be_prefixed_with_I.style = interface_prefix_style
157179dotnet_naming_symbols.interfaces.applicable_kinds = interface
158180dotnet_naming_symbols.interfaces.applicable_accessibilities = *
159181
0 commit comments