1+ # ########################################
2+ # Core EditorConfig Options #
3+ # ########################################
4+
5+ # All files
6+ [* ]
7+ charset = utf-8
8+ indent_style = tab
9+ indent_size = 4
10+ insert_final_newline = false
11+ trim_trailing_whitespace = true
12+ spelling_languages = en-us,cs-cz
13+
14+ # #########################################
15+ # File Extension Settings
16+ # #########################################
17+
18+ # Visual Studio XML Project Files
19+ [* .{csproj,vbproj,vcxproj.filters,proj,projitems,shproj} ]
20+ indent_style = space
21+ indent_size = 2
22+
23+ # XML Configuration Files
24+ [* .{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct} ]
25+ indent_style = space
26+ indent_size = 2
27+
28+ # JSON Files
29+ [* .{json,json5,webmanifest} ]
30+ indent_style = space
31+ indent_size = 2
32+
33+ # YAML Files
34+ [* .{yml,yaml} ]
35+ indent_style = space
36+ indent_size = 2
37+
38+ # Markdown Files
39+ [* .{md,mdx} ]
40+ trim_trailing_whitespace = false
41+
42+ # Web Files
43+ [* .{htm,html,js,jsm,ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx,css,sass,scss,less,pcss,svg,vue} ]
44+ indent_size = 2
45+
46+ # Batch Files
47+ [* .{cmd,bat} ]
48+ end_of_line = crlf
49+
50+ # Bash Files
51+ [* .sh ]
52+ end_of_line = lf
53+
54+ # Exclude generated code
55+ [/Migrations/* .cs ]
56+ generated_code = true
57+
58+ # ########################################
59+ # .NET Coding Conventions #
60+ # ########################################
61+ [* .{cs,vb} ]
62+
63+ # Organize usings
64+ dotnet_sort_system_directives_first = true
65+ dotnet_separate_import_directive_groups = false
66+
67+ # this. preferences
68+ dotnet_style_qualification_for_field = false :silent
69+ dotnet_style_qualification_for_property = false :silent
70+ dotnet_style_qualification_for_method = false :silent
71+ dotnet_style_qualification_for_event = false :silent
72+
73+ # Language keywords vs BCL types preferences
74+ dotnet_style_predefined_type_for_locals_parameters_members = true :silent
75+ dotnet_style_predefined_type_for_member_access = true :silent
76+
77+ # Parentheses preferences
78+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
79+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
80+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
81+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
82+
83+ # Modifier preferences
84+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
85+ dotnet_style_readonly_field = true :suggestion
86+
87+ # Expression-level preferences
88+ dotnet_style_object_initializer = true :suggestion
89+ dotnet_style_collection_initializer = true :suggestion
90+ dotnet_style_explicit_tuple_names = true :warning
91+ dotnet_style_null_propagation = true :suggestion
92+ dotnet_style_coalesce_expression = true :suggestion
93+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :silent
94+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
95+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
96+ dotnet_style_prefer_auto_properties = true :warning
97+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
98+ dotnet_style_prefer_conditional_expression_over_return = true :silent
99+
100+ # ########################################
101+ # Naming Conventions #
102+ # ########################################
103+
104+ # Naming rules
105+ dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
106+ dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
107+ dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
108+
109+ dotnet_naming_rule.types_should_be_pascal_case.severity = warning
110+ dotnet_naming_rule.types_should_be_pascal_case.symbols = types
111+ dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
112+
113+ dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
114+ dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
115+ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
116+
117+ dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
118+ dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
119+ dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case
120+
121+ dotnet_naming_rule.protected_field_members_should_be_pascal_case.severity = warning
122+ dotnet_naming_rule.protected_field_members_should_be_pascal_case.symbols = protected_field_members
123+ dotnet_naming_rule.protected_field_members_should_be_pascal_case.style = pascal_case
124+
125+ dotnet_naming_rule.private_field_members_should_be_underscore_camel_case.severity = warning
126+ dotnet_naming_rule.private_field_members_should_be_underscore_camel_case.symbols = private_field_members
127+ dotnet_naming_rule.private_field_members_should_be_underscore_camel_case.style = underscore_camel_case
128+
129+ dotnet_naming_rule.parameters_should_be_camel_case.severity = warning
130+ dotnet_naming_rule.parameters_should_be_camel_case.symbols = attributes
131+ dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case
132+
133+ # Symbol specifications
134+ dotnet_naming_symbols.interface.applicable_kinds = interface
135+ dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
136+ # dotnet_naming_symbols.interface.required_modifiers =
137+
138+ dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
139+ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
140+ # dotnet_naming_symbols.types.required_modifiers =
141+
142+ dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
143+ dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
144+ # dotnet_naming_symbols.non_field_members.required_modifiers =
145+
146+ dotnet_naming_symbols.constant_fields.applicable_kinds = field
147+ dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
148+ dotnet_naming_symbols.constant_fields.required_modifiers = const
149+
150+ dotnet_naming_symbols.private_field_members.applicable_kinds = field
151+ dotnet_naming_symbols.private_field_members.applicable_accessibilities = private
152+ # dotnet_naming_symbols.private_field_members.required_modifiers =
153+
154+ dotnet_naming_symbols.protected_field_members.applicable_kinds = field
155+ dotnet_naming_symbols.protected_field_members.applicable_accessibilities = protected
156+ # dotnet_naming_symbols.protected_field_members.required_modifiers =
157+
158+ dotnet_naming_symbols.attributes.applicable_kinds = parameter
159+
160+ # Naming styles
161+ # dotnet_naming_style.pascal_case.required_prefix =
162+ # dotnet_naming_style.pascal_case.required_suffix =
163+ # dotnet_naming_style.pascal_case.word_separator =
164+ dotnet_naming_style.pascal_case.capitalization = pascal_case
165+
166+ dotnet_naming_style.begins_with_i.required_prefix = I
167+ # dotnet_naming_style.begins_with_i.required_suffix =
168+ # dotnet_naming_style.begins_with_i.word_separator =
169+ dotnet_naming_style.begins_with_i.capitalization = pascal_case
170+
171+ # dotnet_naming_style.camel_case.required_prefix =
172+ # dotnet_naming_style.camel_case.required_suffix =
173+ # dotnet_naming_style.camel_case.word_separator =
174+ dotnet_naming_style.camel_case.capitalization = camel_case
175+
176+ dotnet_naming_style.underscore_camel_case.required_prefix = _
177+ dotnet_naming_style.underscore_camel_case.capitalization = camel_case
178+
179+ # ########################################
180+ # C# Coding Conventions #
181+ # ########################################
182+
183+ [* .cs ]
184+
185+ # var preferences
186+ csharp_style_var_for_built_in_types = false :silent
187+ csharp_style_var_when_type_is_apparent = false :silent
188+ csharp_style_var_elsewhere = false :silent
189+
190+ # Expression-bodied members
191+ csharp_style_expression_bodied_methods = false :silent
192+ csharp_style_expression_bodied_constructors = false :silent
193+ csharp_style_expression_bodied_operators = false :silent
194+ csharp_style_expression_bodied_properties = true :silent
195+ csharp_style_expression_bodied_indexers = true :silent
196+ csharp_style_expression_bodied_accessors = true :silent
197+
198+ # Pattern matching preferences
199+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
200+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
201+
202+ # Null-checking preferences
203+ csharp_style_throw_expression = true :suggestion
204+ csharp_style_conditional_delegate_call = true :suggestion
205+
206+ # Modifier preferences
207+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
208+
209+ # Pattern matching preferences ???
210+ csharp_style_prefer_switch_expression = true :suggestion
211+
212+ # Expression-level preferences
213+ csharp_prefer_braces = true :suggestion
214+ csharp_prefer_simple_using_statement = false :silent
215+ csharp_prefer_simple_default_expression = true :suggestion
216+ csharp_style_deconstructed_variable_declaration = true :suggestion
217+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
218+ csharp_style_inlined_variable_declaration = true :suggestion
219+ csharp_style_implicit_object_creation_when_type_is_apparent = false :silent
220+
221+ csharp_using_directive_placement = outside_namespace:warning
222+
223+ # File scoped namespaces
224+ csharp_style_namespace_declarations =file_scoped:suggestion
225+
226+ # ########################################
227+ # C# Formatting Rules #
228+ # ########################################
229+
230+ # New line preferences
231+ csharp_new_line_before_open_brace = all
232+ csharp_new_line_before_else = true
233+ csharp_new_line_before_catch = true
234+ csharp_new_line_before_finally = true
235+ csharp_new_line_before_members_in_object_initializers = true
236+ csharp_new_line_before_members_in_anonymous_types = true
237+ csharp_new_line_between_query_expression_clauses = true
238+
239+ # Indentation preferences
240+ csharp_indent_case_contents = true
241+ csharp_indent_switch_labels = true
242+ csharp_indent_block_contents = true
243+ csharp_indent_labels = flush_left
244+ csharp_indent_braces = false
245+
246+ # Space preferences
247+ csharp_space_after_cast = false
248+ csharp_space_after_keywords_in_control_flow_statements = true
249+ csharp_space_between_method_call_parameter_list_parentheses = false
250+ csharp_space_between_method_declaration_parameter_list_parentheses = false
251+ csharp_space_between_parentheses = false
252+ csharp_space_before_colon_in_inheritance_clause = true
253+ csharp_space_after_colon_in_inheritance_clause = true
254+ csharp_space_around_binary_operators = before_and_after
255+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
256+ csharp_space_between_method_call_name_and_opening_parenthesis = false
257+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
258+ csharp_space_between_method_declaration_name_and_open_parenthesis = false
259+ csharp_space_after_comma = true
260+ csharp_space_before_comma = false
261+ csharp_space_after_dot = false
262+ csharp_space_before_dot = false
263+ csharp_space_after_semicolon_in_for_statement = true
264+ csharp_space_before_semicolon_in_for_statement = false
265+ csharp_space_around_declaration_statements = do_not_ignore
266+ csharp_space_before_open_square_brackets = false
267+ csharp_space_between_empty_square_brackets = false
268+ csharp_space_between_square_brackets = false
269+
270+ # Wrapping preferences
271+ csharp_preserve_single_line_statements = true
272+ csharp_preserve_single_line_blocks = true
273+
274+ # ########################################
275+ # Microsoft.CodeAnalysis.FxCopAnalyzers #
276+ # ########################################
277+
278+ # CA1001: Types that own disposable fields should be disposable
279+ dotnet_diagnostic.CA1001.severity = warning
280+
281+ # CA1030: Use events where appropriate
282+ dotnet_diagnostic.CA1030.severity = none
283+
284+ # CA1040: Avoid empty interfaces
285+ dotnet_diagnostic.CA1040.severity = none
286+
287+ # CA1052: Static holder types should be Static or NotInheritable
288+ dotnet_diagnostic.CA1052.severity = none
289+
290+ # CA1062: Validate arguments of public methods
291+ dotnet_diagnostic.CA1062.severity = none
292+
293+ # CA1515: Consider making public types internal
294+ dotnet_diagnostic.CA1515.severity = none
295+
296+ # CA1707: Identifiers should not contain underscores
297+ dotnet_diagnostic.CA1707.severity = none
298+
299+ # CA1711: Identifiers should not have incorrect suffix
300+ dotnet_diagnostic.CA1711.severity = none
301+
302+ # CA1716: Identifiers should not match keywords
303+ dotnet_diagnostic.CA1716.severity = none
304+
305+ # CA1724: Type names should not match namespaces
306+ dotnet_diagnostic.CA1724.severity = none
307+
308+ # CA1812: Avoid uninstantiated internal classes
309+ dotnet_diagnostic.CA1812.severity = none
310+
311+ # CA1819: Properties should not return arrays
312+ dotnet_diagnostic.CA1819.severity = none
313+
314+ # CA2007: Consider calling ConfigureAwait on the awaited task
315+ dotnet_diagnostic.CA2007.severity = none
316+
317+ # ########################################
318+ # Language rules (expression-level preferences)
319+ # ########################################
320+
321+ # IDE0305: Using directive is unnecessary
322+ dotnet_diagnostic.IDE0305.severity = none
323+
324+ # ########################################
325+ # StyleCop.Analyzers #
326+ # ########################################
327+
328+ # SA1101: Prefix local calls with this
329+ dotnet_diagnostic.SA1027.severity = none
330+
331+ # SA1101: Prefix local calls with this
332+ dotnet_diagnostic.SA1101.severity = none
333+
334+ # SA1200: Using directives must be placed correctly
335+ dotnet_diagnostic.SA1200.severity = none
336+
337+ # SA1633: File must have header
338+ dotnet_diagnostic.SA1633.severity = none
339+
340+ # ########################################
341+ # System.Runtime.Analyzers #
342+ # ########################################
343+
344+ # ########################################
345+ # Roslynator.Analyzers #
346+ # ########################################
347+
348+ # RCS1003: Add braces to if-else (when expression spans over multiple lines)
349+ # dotnet_diagnostic.RCS1003.severity = warning
350+ # RCS1005: Simplify nested using statement
351+ # dotnet_diagnostic.RCS1005.severity = suggestion
352+ # RCS1006: Merge 'else' with nested 'if'
353+ # dotnet_diagnostic.RCS1006.severity = suggestion
354+ # RCS1007: Add braces
355+ # dotnet_diagnostic.RCS1007.severity = warning
356+ # RCS1013: Use predefined type
357+ # dotnet_diagnostic.RCS1013.severity = warning
358+ # RCS1015: Use nameof operator
359+ dotnet_diagnostic.RCS1015.severity = warning
360+ # RCS1018: Add accessibility modifiers
361+ dotnet_diagnostic.RCS1018.severity = warning
362+ # RCS1036: Remove redundant empty line
363+ dotnet_diagnostic.RCS1036.severity = warning
364+ # RCS1037: Remove trailing white-space
365+ dotnet_diagnostic.RCS1037.severity = warning
366+ # RCS1046: Asynchronous method name should end with 'Async'
367+ dotnet_diagnostic.RCS1046.severity = warning
368+ # RCS1047: Non-asynchronous method name should not end with 'Async'
369+ dotnet_diagnostic.RCS1047.severity = warning
370+ # RCS1057: Add empty line between declarations
371+ dotnet_diagnostic.RCS1057.severity = warning
372+ # RCS1090: Call 'ConfigureAwait(false)'
373+ dotnet_diagnostic.RCS1090.severity = silent
374+ # RCS1097: Remove redundant 'ToString' call
375+ dotnet_diagnostic.RCS1097.severity = warning
376+ # RCS1225: Make class sealed
377+ dotnet_diagnostic.RCS1225.severity = warning
378+
379+ [* {Controller,Tests,.razor}.cs ]
380+ # Ignore Async suffix for controller's actions, test classes and razor components
381+ # RCS1046: Asynchronous method name should end with 'Async'
382+ dotnet_diagnostic.RCS1046.severity = none
0 commit comments