11# Remove the line below if you want to inherit .editorconfig settings from higher directories
22root = true
33
4- [* ]
5- # ### Core EditorConfig Options ####
4+ # ### Global Settings ####
65
6+ [* ]
77# Indentation and spacing
88indent_size = 4
99indent_style = space
10- tab_width = 4
1110
1211# New line preferences
1312end_of_line = lf
1413insert_final_newline = true
1514
16- # Razor files
17- [* .{cs,razor} ]
18- dotnet_diagnostic.CA2007.severity = none
15+ # ### JSON Files ####
16+
17+ [* .json ]
18+ indent_size = 2
19+ tab_width = 2
20+
21+ # ### MSBuild Files ####
22+
23+ [* .{csproj,props,targets} ]
24+ indent_size = 2
25+ tab_width = 2
26+
27+ # ### C# Files ####
1928
20- # C# files
2129[* .cs ]
22- # ### .NET Coding Conventions ####
30+
31+ # .NET Coding Conventions
2332
2433# this. and Me. preferences
2534dotnet_style_qualification_for_event = false
@@ -40,10 +49,13 @@ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
4049# Modifier preferences
4150dotnet_style_require_accessibility_modifiers = for_non_interface_members
4251
52+ # Field preferences
53+ dotnet_style_readonly_field = true :suggestion
54+
55+ # Parameter preferences
56+ dotnet_code_quality_unused_parameters = all:suggestion
57+
4358# Expression-level preferences
44- csharp_style_deconstructed_variable_declaration = true :suggestion
45- csharp_style_inlined_variable_declaration = true :suggestion
46- csharp_style_throw_expression = true :suggestion
4759dotnet_style_coalesce_expression = true :suggestion
4860dotnet_style_collection_initializer = true :suggestion
4961dotnet_style_explicit_tuple_names = true :suggestion
@@ -57,13 +69,7 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
5769dotnet_style_prefer_inferred_tuple_names = true :suggestion
5870dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
5971
60- # Field preferences
61- dotnet_style_readonly_field = true :suggestion
62-
63- # Parameter preferences
64- dotnet_code_quality_unused_parameters = all:suggestion
65-
66- # ### C# Coding Conventions ####
72+ # C# Coding Conventions
6773
6874# var preferences
6975csharp_style_var_elsewhere = false :warning
@@ -94,6 +100,9 @@ csharp_preferred_modifier_order = public, private, protected, internal, static,
94100csharp_prefer_braces = true
95101
96102# Expression-level preferences
103+ csharp_style_deconstructed_variable_declaration = true :suggestion
104+ csharp_style_inlined_variable_declaration = true :suggestion
105+ csharp_style_throw_expression = true :suggestion
97106csharp_prefer_simple_default_expression = true :suggestion
98107csharp_style_pattern_local_over_anonymous_function = true :suggestion
99108csharp_style_prefer_index_operator = true :suggestion
@@ -104,15 +113,13 @@ csharp_style_unused_value_expression_statement_preference = discard_variable
104113# 'using' directive preferences
105114csharp_using_directive_placement = inside_namespace
106115
107- # Constructor Preferences
116+ # Constructor preferences
108117csharp_style_prefer_primary_constructors = false
109- dotnet_diagnostic.IDE0290.severity = none
110- resharper_convert_to_primary_constructor_highlighting = none
111118
112- # ### C# Formatting Rules ####
119+ # C# Formatting Rules
113120
114121# New line preferences
115- csharp_new_line_before_open_brace = methods, properties, control_blocks, types
122+ csharp_new_line_before_open_brace = all
116123csharp_new_line_before_catch = true
117124csharp_new_line_before_else = true
118125csharp_new_line_before_finally = true
@@ -129,7 +136,7 @@ csharp_indent_labels = one_less_than_current
129136csharp_indent_switch_labels = true
130137
131138# Space preferences
132- csharp_space_after_cast = true
139+ csharp_space_after_cast = false
133140csharp_space_after_colon_in_inheritance_clause = true
134141csharp_space_after_comma = true
135142csharp_space_after_dot = false
@@ -156,13 +163,12 @@ csharp_space_between_square_brackets = false
156163csharp_preserve_single_line_blocks = true
157164csharp_preserve_single_line_statements = true
158165
159- # ### Resharper Formatting Rules ####
166+ # ReSharper Formatting Rules
160167
161- resharper_csharp_accessor_declaration_braces = next_line
162- resharper_csharp_accessor_owner_declaration_braces = next_line
163- resharper_csharp_align_first_arg_by_paren = true
168+ # Alignment
169+ resharper_csharp_align_first_arg_by_paren = false
164170resharper_csharp_align_linq_query = true
165- resharper_csharp_align_multiline_argument = true
171+ resharper_csharp_align_multiline_argument = false
166172resharper_csharp_align_multiline_array_and_object_initializer = false
167173resharper_csharp_align_multiline_binary_expressions_chain = true
168174resharper_csharp_align_multiline_binary_patterns = true
@@ -179,10 +185,20 @@ resharper_csharp_align_multline_type_parameter_list = true
179185resharper_csharp_align_tuple_components = true
180186resharper_csharp_alignment_tab_fill_style = optimal_fill
181187resharper_csharp_allow_far_alignment = true
188+
189+ # Braces
190+ resharper_csharp_accessor_declaration_braces = next_line
191+ resharper_csharp_accessor_owner_declaration_braces = next_line
182192resharper_csharp_brace_style = next_line
183193resharper_csharp_case_block_braces = next_line
194+ resharper_csharp_initializer_braces = next_line
195+ resharper_csharp_invocable_declaration_braces = next_line
196+ resharper_csharp_other_braces = next_line
197+ resharper_csharp_type_declaration_braces = next_line
198+
199+ # Indentation
184200resharper_csharp_continuous_indent_multiplier = 1
185- resharper_csharp_indent_anonymous_method_block = true
201+ resharper_csharp_indent_anonymous_method_block = false
186202resharper_csharp_indent_braces_inside_statement_conditions = true
187203resharper_csharp_indent_inside_namespace = true
188204resharper_csharp_indent_nested_fixed_stmt = false
@@ -195,24 +211,49 @@ resharper_csharp_indent_preprocessor_if = no_indent
195211resharper_csharp_indent_preprocessor_other = usual_indent
196212resharper_csharp_indent_preprocessor_region = no_indent
197213resharper_csharp_indent_type_constraints = true
198- resharper_csharp_initializer_braces = next_line
199- resharper_csharp_invocable_declaration_braces = next_line
214+
215+ # Wrapping and layout
200216resharper_csharp_keep_existing_attribute_arrangement = false
201217resharper_csharp_keep_existing_initializer_arrangement = false
202218resharper_csharp_max_attribute_length_for_same_line = 120
203219resharper_csharp_max_initializer_elements_on_line = 1
204- resharper_csharp_naming_rule.enum_member = AaBb
205- resharper_csharp_other_braces = next_line
206220resharper_csharp_outdent_binary_ops = true
207221resharper_csharp_outdent_binary_pattern_ops = true
208222resharper_csharp_outdent_dots = true
209223resharper_csharp_place_attribute_on_same_line = false
210224resharper_csharp_place_record_field_attribute_on_same_line = true
211225resharper_csharp_place_simple_initializer_on_single_line = true
212- resharper_csharp_type_declaration_braces = next_line
213226resharper_csharp_wrap_object_and_collection_initializer_style = chop_always
227+ resharper_csharp_wrap_array_initializer_style = chop_always
228+
229+ # Naming conventions
230+ resharper_csharp_naming_rule.enum_member = PascalCase
214231
232+ # Diagnostic Severity Overrides
215233dotnet_diagnostic.CA2007.severity = error
234+ dotnet_diagnostic.IDE0290.severity = none
235+ resharper_convert_to_primary_constructor_highlighting = none
236+
237+ # Meziantou Rules
238+ dotnet_diagnostic.MA0003.severity = none
239+
240+ # ### Razor Files ####
241+
242+ [* .{razor,razor.cs} ]
243+ # Diagnostic severity overrides
244+ dotnet_diagnostic.CA2007.severity = none
245+ dotnet_diagnostic.CA1515.severity = none
246+ dotnet_diagnostic.CA1822.severity = suggestion
247+ dotnet_diagnostic.CA1823.severity = suggestion
248+ dotnet_diagnostic.IDE0044.severity = suggestion
249+ dotnet_diagnostic.IDE0051.severity = none
250+ dotnet_diagnostic.IDE0052.severity = none
251+ dotnet_diagnostic.IDE0060.severity = none
252+ dotnet_diagnostic.S1144.severity = suggestion
216253
217- # warning suppressions
218- dotnet_diagnostic.CA2255.severity = none
254+ # Disable CA1707 for test sources only
255+ [tests/** .cs ]
256+ dotnet_diagnostic.CA1031.severity = none
257+ dotnet_diagnostic.CA1308.severity = none
258+ dotnet_diagnostic.CA1707.severity = none
259+ dotnet_diagnostic.MA0038.severity = none
0 commit comments