1+
2+ # Suppress: EC112
3+ # top-most EditorConfig file
4+ root = true
5+
6+ # Default settings:
7+ # A newline ending every file
8+ # Use 4 spaces as indentation
9+ [* ]
10+ insert_final_newline = false
11+ indent_style = space
12+ indent_size = 4
13+
14+ # Code files
15+ [* .{cs,csx,vb,vbx} ]
16+ indent_style = tab
17+ indent_size = 4
18+ dotnet_style_operator_placement_when_wrapping = beginning_of_line
19+ tab_width = 4
20+ end_of_line = crlf
21+ dotnet_style_coalesce_expression = true :suggestion
22+ dotnet_style_null_propagation = true :suggestion
23+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
24+ dotnet_style_prefer_auto_properties = true :silent
25+ dotnet_style_object_initializer = true :suggestion
26+ dotnet_style_collection_initializer = true :suggestion
27+ dotnet_style_prefer_simplified_boolean_expressions = true :suggestion
28+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
29+ dotnet_style_prefer_conditional_expression_over_return = true :silent
30+ dotnet_style_explicit_tuple_names = true :suggestion
31+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
32+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
33+ dotnet_style_prefer_compound_assignment = true :suggestion
34+ dotnet_style_prefer_simplified_interpolation = true :suggestion
35+ dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
36+ dotnet_style_namespace_match_folder = true :suggestion
37+ dotnet_style_readonly_field = true :suggestion
38+ dotnet_style_predefined_type_for_locals_parameters_members = true :silent
39+ dotnet_style_predefined_type_for_member_access = true :silent
40+ dotnet_style_require_accessibility_modifiers = omit_if_default:error
41+
42+ # Code files
43+ [* .sln ]
44+ indent_size = 4
45+
46+ # Xml project files
47+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
48+ indent_size = 2
49+
50+ # Xml config files
51+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
52+ indent_size = 2
53+
54+ # JSON files
55+ [* .json ]
56+ indent_size = 2
57+
58+ # XML files
59+ [* .xml ]
60+ indent_size = 2
61+
62+ [* .cs ]
63+
64+ # Organize usings
65+ dotnet_sort_system_directives_first = true
66+
67+ # IDE0160: Use file scoped namespace
68+ csharp_style_namespace_declarations = file_scoped:error
69+
70+ # CS4014: Because this call is not awaited, execution of the current method continues before the call is completed
71+ dotnet_diagnostic.CS4014.severity = error
72+
73+ # CS2012: ValueTask instances returned from member invocations are intended to be directly awaited. Attempts to consume a ValueTask multiple times or to directly access one's result before it's known to be completed may result in an exception or corruption. Ignoring such a ValueTask is likely an indication of a functional bug and may degrade performance.
74+ dotnet_diagnostic.CS2012.severity = error
75+
76+ # CS1998 : This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
77+ dotnet_diagnostic.CS1998.severity = error
78+
79+ # Remove explicit default access modifiers
80+ dotnet_style_require_accessibility_modifiers = omit_if_default:error
81+
82+ # CA1063: Implement IDisposable Correctly
83+ dotnet_diagnostic.CA1063.severity = error
84+
85+ # CA1001: Type owns disposable field(s) but is not disposable
86+ dotnet_diagnostic.CA1001.severity = error
87+
88+ # Add braces (IDE0011)
89+ csharp_prefer_braces = false :warning
90+ dotnet_diagnostic.IDE0011.severity = none
91+
92+ # Pattern matching
93+ dotnet_style_object_initializer = true :suggestion
94+ dotnet_style_collection_initializer = true :suggestion
95+ dotnet_style_coalesce_expression = true :suggestion
96+ dotnet_style_null_propagation = true :suggestion
97+ dotnet_style_explicit_tuple_names = true :suggestion
98+ dotnet_style_prefer_is_null_check_over_reference_equality_method =true :suggestion
99+
100+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
101+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
102+ csharp_style_inlined_variable_declaration = true :suggestion
103+ csharp_style_throw_expression = true :suggestion
104+ csharp_style_conditional_delegate_call = true :suggestion
105+
106+ # Collection Expressions
107+ dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
108+
109+ # Naming rules
110+
111+ dotnet_diagnostic.IDE1006.severity = suggestion
112+
113+ # # Public Fields are kept Pascal Case
114+ dotnet_naming_symbols.public_symbols.applicable_kinds = field
115+ dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal
116+
117+ dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
118+
119+ dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
120+ dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
121+ dotnet_naming_rule.public_members_must_be_capitalized.severity = suggestion
122+
123+ # # Instance fields are camelCase
124+ dotnet_naming_rule.instance_fields_should_be_camel_case.severity = error
125+ dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
126+ dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
127+
128+ dotnet_naming_symbols.instance_fields.applicable_kinds = field
129+
130+ dotnet_naming_style.instance_field_style.capitalization = camel_case
131+ dotnet_naming_style.instance_field_style.required_prefix =
132+
133+ # # Static fields are camelCase
134+ dotnet_naming_rule.static_fields_should_be_camel_case.severity = error
135+ dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
136+ dotnet_naming_rule.static_fields_should_be_camel_case.style = instance_field_style
137+
138+ dotnet_naming_symbols.static_fields.applicable_kinds = field
139+ dotnet_naming_symbols.static_fields.required_modifiers = static
140+ dotnet_naming_symbols.static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
141+
142+ dotnet_naming_style.static_field_style.capitalization = camel_case
143+ dotnet_naming_style.static_field_style.required_prefix =
144+
145+ # Modifier preferences
146+ csharp_prefer_static_local_function = true :suggestion
147+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
148+
149+ # CA1822: Member does not access instance data and can be marked as static
150+ dotnet_diagnostic.CA1822.severity = suggestion
151+
152+ # CA1050: Declare types in namespaces
153+ dotnet_diagnostic.CA1050.severity = error
154+
155+ # CA2016: Forward the 'cancellationToken' parameter methods that take one
156+ dotnet_diagnostic.CA2016.severity = error
157+
158+ # CA1068: CancellationToken parameters must come last
159+ dotnet_diagnostic.CA1068.severity = error
160+
161+ # CA2208: Method passes parameter as the paramName argument to a ArgumentNullException constructor. Replace this argument with one of the method's parameter names. Note that the provided parameter name should have the exact casing as declared on the method.
162+ dotnet_diagnostic.CA2208.severity = error
163+
164+ # CA1834: Use 'StringBuilder.Append(char)' instead of 'StringBuilder.Append(string)' when the input is a constant unit string
165+ dotnet_diagnostic.CA1834.severity = error
166+
167+ # IDE0220: Add explicit cast
168+ dotnet_diagnostic.IDE0220.severity = error
169+ csharp_indent_labels = no_change
170+ csharp_space_around_binary_operators = before_and_after
171+ csharp_using_directive_placement = outside_namespace:silent
172+ csharp_prefer_simple_using_statement = true :suggestion
173+ csharp_style_prefer_method_group_conversion = true :silent
174+ csharp_style_prefer_top_level_statements = true :silent
175+ csharp_style_prefer_primary_constructors = true :suggestion
176+ csharp_prefer_system_threading_lock = true :suggestion
177+ csharp_style_expression_bodied_methods = false :silent
178+ csharp_style_expression_bodied_constructors = false :silent
179+ csharp_style_expression_bodied_operators = false :silent
180+ csharp_style_expression_bodied_properties = true :silent
181+ csharp_style_expression_bodied_indexers = true :silent
182+ csharp_style_expression_bodied_accessors = true :silent
183+ csharp_style_expression_bodied_lambdas = true :silent
184+ csharp_style_expression_bodied_local_functions = false :silent
185+ csharp_style_prefer_null_check_over_type_check = true :suggestion
186+ csharp_prefer_simple_default_expression = true :suggestion
187+ csharp_style_prefer_local_over_anonymous_function = true :suggestion
188+ csharp_style_prefer_index_operator = true :suggestion
189+ csharp_style_prefer_range_operator = true :suggestion
190+ csharp_style_implicit_object_creation_when_type_is_apparent = true :suggestion
191+ csharp_style_prefer_tuple_swap = true :suggestion
192+ csharp_style_prefer_utf8_string_literals = true :suggestion
193+ csharp_style_deconstructed_variable_declaration = true :suggestion
194+ csharp_style_unused_value_assignment_preference = discard_variable:suggestion
195+ csharp_style_unused_value_expression_statement_preference = discard_variable:silent
196+ csharp_prefer_static_anonymous_function = true :suggestion
197+ csharp_style_prefer_readonly_struct = true :suggestion
0 commit comments