1+ # EditorConfig is awesome: https://EditorConfig.org
2+
3+ # top-most EditorConfig file
4+ root = true
5+
6+ # All files
7+ [* ]
8+ charset = utf-8
9+ end_of_line = lf
10+ insert_final_newline = true
11+ trim_trailing_whitespace = true
12+
13+ # Code files
14+ [* .{cs,js,ts,tsx,jsx,json,xml,yml,yaml} ]
15+ indent_style = space
16+ indent_size = 2
17+
18+ # C# files
19+ [* .cs ]
20+ indent_size = 4
21+
22+ # .NET project files
23+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
24+ indent_size = 2
25+
26+ # .NET solution files
27+ [* .sln ]
28+ indent_style = tab
29+
30+ # JSON files
31+ [* .json ]
32+ indent_size = 2
33+
34+ # YAML files
35+ [* .{yml,yaml} ]
36+ indent_size = 2
37+
38+ # Markdown files
39+ [* .md ]
40+ trim_trailing_whitespace = false
41+
42+ # Batch files
43+ [* .{cmd,bat} ]
44+ end_of_line = crlf
45+
46+ # Makefiles
47+ [{Makefile,makefile} ]
48+ indent_style = tab
49+
50+ # Shell scripts
51+ [* .sh ]
52+ end_of_line = lf
53+
54+ # C# Coding Conventions
55+ [* .cs ]
56+
57+ # Code style rules
58+ dotnet_sort_system_directives_first = true
59+ dotnet_separate_import_directive_groups = false
60+
61+ # this. preferences
62+ dotnet_style_qualification_for_field = false :suggestion
63+ dotnet_style_qualification_for_property = false :suggestion
64+ dotnet_style_qualification_for_method = false :suggestion
65+ dotnet_style_qualification_for_event = false :suggestion
66+
67+ # Language keywords vs BCL types preferences
68+ dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
69+ dotnet_style_predefined_type_for_member_access = true :suggestion
70+
71+ # Parentheses preferences
72+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
73+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
74+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
75+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
76+
77+ # Modifier preferences
78+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
79+ dotnet_style_readonly_field = true :suggestion
80+
81+ # Expression-level preferences
82+ dotnet_style_object_initializer = true :suggestion
83+ dotnet_style_collection_initializer = true :suggestion
84+ dotnet_style_explicit_tuple_names = true :suggestion
85+ dotnet_style_null_propagation = true :suggestion
86+ dotnet_style_coalesce_expression = true :suggestion
87+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
88+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
89+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
90+ dotnet_style_prefer_auto_properties = true :silent
91+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
92+ dotnet_style_prefer_conditional_expression_over_return = true :silent
93+
94+ # C# preferences
95+ csharp_new_line_before_open_brace = all
96+ csharp_new_line_before_else = true
97+ csharp_new_line_before_catch = true
98+ csharp_new_line_before_finally = true
99+ csharp_new_line_before_members_in_object_initializers = true
100+ csharp_new_line_before_members_in_anonymous_types = true
101+ csharp_new_line_between_query_expression_clauses = true
102+
103+ # Indentation preferences
104+ csharp_indent_case_contents = true
105+ csharp_indent_switch_labels = true
106+ csharp_indent_labels = flush_left
107+
108+ # Space preferences
109+ csharp_space_after_cast = false
110+ csharp_space_after_keywords_in_control_flow_statements = true
111+ csharp_space_between_method_call_parameter_list_parentheses = false
112+ csharp_space_between_method_declaration_parameter_list_parentheses = false
113+ csharp_space_between_parentheses = false
114+ csharp_space_before_colon_in_inheritance_clause = true
115+ csharp_space_after_colon_in_inheritance_clause = true
116+ csharp_space_around_binary_operators = before_and_after
117+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
118+ csharp_space_between_method_call_name_and_opening_parenthesis = false
119+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
120+
121+ # Wrapping preferences
122+ csharp_preserve_single_line_statements = true
123+ csharp_preserve_single_line_blocks = true
124+
125+ # var preferences
126+ csharp_style_var_for_built_in_types = false :suggestion
127+ csharp_style_var_when_type_is_apparent = true :suggestion
128+ csharp_style_var_elsewhere = false :suggestion
129+
130+ # Expression-bodied members
131+ csharp_style_expression_bodied_methods = false :silent
132+ csharp_style_expression_bodied_constructors = false :silent
133+ csharp_style_expression_bodied_operators = false :silent
134+ csharp_style_expression_bodied_properties = true :silent
135+ csharp_style_expression_bodied_indexers = true :silent
136+ csharp_style_expression_bodied_accessors = true :silent
137+
138+ # Pattern matching preferences
139+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
140+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
141+
142+ # Null-checking preferences
143+ csharp_style_throw_expression = true :suggestion
144+ csharp_style_conditional_delegate_call = true :suggestion
145+
146+ # Modifier preferences
147+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
148+
149+ # Expression preferences
150+ csharp_prefer_braces = true :silent
151+ csharp_style_deconstructed_variable_declaration = true :suggestion
152+ csharp_prefer_simple_using_statement = true :suggestion
153+ csharp_style_prefer_switch_expression = true :suggestion
154+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
155+
156+ # File-scoped namespaces
157+ csharp_style_namespace_declarations = file_scoped:warning
158+
159+ # Code quality rules
160+ dotnet_code_quality_unused_parameters = all:suggestion
161+
162+ # Naming conventions
163+ dotnet_naming_rule.interface_should_be_prefixed_with_i.severity = warning
164+ dotnet_naming_rule.interface_should_be_prefixed_with_i.symbols = interface
165+ dotnet_naming_rule.interface_should_be_prefixed_with_i.style = prefix_interface_with_i
166+
167+ dotnet_naming_rule.types_should_be_pascal_case.severity = warning
168+ dotnet_naming_rule.types_should_be_pascal_case.symbols = types
169+ dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
170+
171+ dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
172+ dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
173+ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
174+
175+ # Symbol specifications
176+ dotnet_naming_symbols.interface.applicable_kinds = interface
177+ dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
178+ dotnet_naming_symbols.interface.required_modifiers =
179+
180+ dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
181+ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
182+ dotnet_naming_symbols.types.required_modifiers =
183+
184+ dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
185+ dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
186+ dotnet_naming_symbols.non_field_members.required_modifiers =
187+
188+ # Naming styles
189+ dotnet_naming_style.pascal_case.required_prefix =
190+ dotnet_naming_style.pascal_case.required_suffix =
191+ dotnet_naming_style.pascal_case.word_separator =
192+ dotnet_naming_style.pascal_case.capitalization = pascal_case
193+
194+ dotnet_naming_style.prefix_interface_with_i.required_prefix = I
195+ dotnet_naming_style.prefix_interface_with_i.required_suffix =
196+ dotnet_naming_style.prefix_interface_with_i.word_separator =
197+ dotnet_naming_style.prefix_interface_with_i.capitalization = pascal_case
0 commit comments