1+ #  EditorConfig is awesome: https://editorconfig.org
2+ #  IDE0055 reports many issues related to spaces and line breaks, so it is disabled.
3+ 
4+ #  top-most EditorConfig file
15root  = true 
26
7+ #  General
38[* 
49charset  = utf-8 
510end_of_line  = lf 
6- trim_trailing_whitespace  = false 
7- insert_final_newline  = false 
11+ insert_final_newline  = true 
812indent_style  = space 
913indent_size  = 2 
1014
11- [{appsettings.json,appsettings.* .json} ]
12- charset  = utf-8-bom 
13- indent_style  = space 
14- indent_size  = 4 
15- 
1615[* .cs
16+ trim_trailing_whitespace  = true 
17+ insert_final_newline  = true 
1718indent_style  = space 
1819indent_size  = 4 
1920tab_width  = 4 
2021
21- #  StyleCop Diagnostic Rules =================
22- 
2322#  Always insert a newline before opening braces '{'
24- csharp_new_line_before_open_brace  = methods,  properties,  control_blocks,  types 
25- #  Display multiple statements and member declarations on a single line
26- csharp_preserve_single_line_statements  = false 
27- #  Allow code blocks to remain on a single line if they fit
28- csharp_preserve_single_line_blocks  = true 
23+ csharp_new_line_before_open_brace  = all 
24+ 
2925#  switch case Indent the content.
3026csharp_indent_case_contents  = true 
3127#  Indent switch label
@@ -38,12 +34,13 @@ csharp_indent_block_contents = true
3834csharp_indent_braces  = false 
3935#  Indent the statement list and curly braces in the case of a switch statement.
4036csharp_indent_case_contents_when_block  = false 
37+ 
4138#  Insert spaces after cast operators
4239csharp_space_after_cast  = true 
4340#  Insert a space after control flow keywords ('if', 'while', 'for', etc.)
4441csharp_space_after_keywords_in_control_flow_statements  = true 
4542#  Do not insert spaces within parentheses '()'
46- csharp_space_between_parentheses  = control_flow_statements 
43+ csharp_space_between_parentheses  = false 
4744#  Insert a space before colons ':' in inheritance clauses
4845csharp_space_before_colon_in_inheritance_clause  = true 
4946#  Insert spaces after colons ':' in inheritance clauses
@@ -80,12 +77,19 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
8077csharp_space_between_method_declaration_parameter_list_parentheses  = false 
8178#  Do not insert spaces within square brackets '[]'
8279csharp_space_between_square_brackets  = false 
80+ 
81+ #  Display multiple statements and member declarations on a single line
82+ csharp_preserve_single_line_statements  = false 
83+ #  Allow code blocks to remain on a single line if they fit
84+ csharp_preserve_single_line_blocks  = true 
85+ 
8386#  Recommend using type inference ('var') for variable declarations
8487csharp_style_var_elsewhere  = true :suggestion 
8588#  Recommend using type inference ('var') for built-in types (e.g., 'int')
8689csharp_style_var_for_built_in_types  = true :suggestion 
8790#  Recommend using type inference ('var') when the type is apparent
8891csharp_style_var_when_type_is_apparent  = true :suggestion 
92+ 
8993#  Always use braces for control structures
9094csharp_prefer_braces  = true :warning 
9195csharp_prefer_simple_using_statement  = true :warning 
@@ -101,7 +105,6 @@ dotnet_style_qualification_for_method = false:suggestion
101105#  Avoid requiring explicit qualifiers (e.g., `this.`) when accessing properties.
102106dotnet_style_qualification_for_property  = false :suggestion 
103107
104- #  StyleCop Diagnostic Rules =================
105108
106109#  Add braces (`{}`) to if or while statements
107110dotnet_diagnostic.IDE0011.severity  = warning 
@@ -236,6 +239,7 @@ dotnet_diagnostic.SA9001.severity = none
236239#  Reserved for custom or experimental rules.
237240dotnet_diagnostic.SA9002.severity  = none 
238241
242+ 
239243#  C# Naming Rules (Classes and Interfaces) =================
240244
241245#  Public classes
0 commit comments