@@ -3,12 +3,24 @@ root = true
33[* ]
44charset = utf-8
55indent_style = space
6- indent_size = 4
6+ indent_size = 2
77end_of_line = crlf
88trim_trailing_whitespace = true
99insert_final_newline = true
1010
11- # Dotnet code style settings:
11+ # Project files
12+ [* .{csproj,props} ]
13+ insert_final_newline = false
14+
15+ # HTML files
16+ [* .{html,htm} ]
17+ insert_final_newline = false
18+
19+ # Code
20+ [* .{cs,js,ts,ps1,sh,bat,cmd} ]
21+ indent_size = 4
22+
23+ # Dotnet code style settings
1224[* .{cs,vb} ]
1325
1426# Sort using and Import directives with System.* appearing first
@@ -24,16 +36,24 @@ dotnet_style_qualification_for_event = false:suggestion
2436dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
2537dotnet_style_predefined_type_for_member_access = true :suggestion
2638
39+ # Use explicit accessibility modifiers
40+ dotnet_style_require_accessibility_modifiers = true :suggestion
41+
2742# Suggest more modern language features when available
2843dotnet_style_object_initializer = true :suggestion
2944dotnet_style_collection_initializer = true :suggestion
3045dotnet_style_coalesce_expression = true :suggestion
3146dotnet_style_null_propagation = true :suggestion
3247dotnet_style_explicit_tuple_names = true :suggestion
48+ dotnet_prefer_inferred_tuple_names = true :suggestion
49+ dotnet_prefer_inferred_anonymous_type_member_names = true :suggestion
3350
34- # CSharp code style settings:
51+ # CSharp code style settings
3552[* .cs ]
3653
54+ # Prefer curly braces even for one line of code
55+ csharp_prefer_braces = true :suggestion
56+
3757# Prefer "var" everywhere
3858csharp_style_var_for_built_in_types = true :suggestion
3959csharp_style_var_when_type_is_apparent = true :suggestion
@@ -55,6 +75,9 @@ csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
5575csharp_style_inlined_variable_declaration = true :suggestion
5676csharp_style_throw_expression = true :suggestion
5777csharp_style_conditional_delegate_call = true :suggestion
78+ csharp_prefer_simple_default_expression = true :suggestion
79+ csharp_style_deconstructed_variable_declaration = true :suggestion
80+ csharp_style_pattern_local_over_anonymous_function = true :suggestion
5881
5982# Newline settings
6083csharp_new_line_before_open_brace = all
@@ -63,12 +86,84 @@ csharp_new_line_before_catch = true
6386csharp_new_line_before_finally = true
6487csharp_new_line_before_members_in_object_initializers = true
6588csharp_new_line_before_members_in_anonymous_types = true
89+ csharp_new_line_between_query_expression_clauses = true
6690
67- # JSON code style settings
68- [* .json ]
69- indent_style = space
70- indent_size = 2
91+ csharp_indent_case_contents = true
92+ csharp_indent_switch_labels = true
93+ csharp_indent_labels = flush_left
94+
95+ csharp_space_after_cast = false
96+ csharp_space_after_keywords_in_control_flow_statements = true
97+ csharp_space_between_method_declaration_parameter_list_parentheses = false
98+ csharp_space_between_method_call_parameter_list_parentheses = false
99+ csharp_space_between_parentheses = false
100+
101+ csharp_preserve_single_line_statements = false
102+ csharp_preserve_single_line_blocks = true
103+ csharp_using_directive_placement = outside_namespace:silent
104+ csharp_prefer_simple_using_statement = true :suggestion
105+ csharp_style_namespace_declarations = file_scoped:silent
106+ csharp_style_prefer_method_group_conversion = true :silent
107+ csharp_style_prefer_top_level_statements = true :silent
108+ csharp_style_expression_bodied_lambdas = true :silent
109+ csharp_style_expression_bodied_local_functions = false :silent
110+
111+ [* .{cs,vb} ]
112+ # ### Naming styles ####
113+
114+ # Naming rules
115+
116+ dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
117+ dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
118+ dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
119+
120+ dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
121+ dotnet_naming_rule.types_should_be_pascal_case.symbols = types
122+ dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
123+
124+ dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
125+ dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
126+ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
127+
128+ # Symbol specifications
129+
130+ dotnet_naming_symbols.interface.applicable_kinds = interface
131+ dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
132+ dotnet_naming_symbols.interface.required_modifiers =
133+
134+ dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
135+ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
136+ dotnet_naming_symbols.types.required_modifiers =
137+
138+ dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
139+ dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
140+ dotnet_naming_symbols.non_field_members.required_modifiers =
141+
142+ # Naming styles
143+
144+ dotnet_naming_style.begins_with_i.required_prefix = I
145+ dotnet_naming_style.begins_with_i.required_suffix =
146+ dotnet_naming_style.begins_with_i.word_separator =
147+ dotnet_naming_style.begins_with_i.capitalization = pascal_case
148+
149+ dotnet_naming_style.pascal_case.required_prefix =
150+ dotnet_naming_style.pascal_case.required_suffix =
151+ dotnet_naming_style.pascal_case.word_separator =
152+ dotnet_naming_style.pascal_case.capitalization = pascal_case
71153
72- # HTML code style settings
73- [* .html ]
74- insert_final_newline = false
154+ dotnet_naming_style.pascal_case.required_prefix =
155+ dotnet_naming_style.pascal_case.required_suffix =
156+ dotnet_naming_style.pascal_case.word_separator =
157+ dotnet_naming_style.pascal_case.capitalization = pascal_case
158+ dotnet_style_operator_placement_when_wrapping = beginning_of_line
159+ tab_width = 4
160+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
161+ dotnet_style_prefer_auto_properties = true :silent
162+ dotnet_style_prefer_simplified_boolean_expressions = true :suggestion
163+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
164+ dotnet_style_prefer_conditional_expression_over_return = true :silent
165+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
166+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
167+ dotnet_style_prefer_compound_assignment = true :suggestion
168+ dotnet_style_prefer_simplified_interpolation = true :suggestion
169+ dotnet_style_namespace_match_folder = true :suggestion
0 commit comments