1
1
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2
2
root = true
3
3
4
- # C# files
5
- [* .cs ]
4
+ [* ]
6
5
7
6
# ### Core EditorConfig Options ####
8
7
9
8
# Indentation and spacing
10
9
indent_size = 4
11
10
indent_style = space
12
11
tab_width = 4
12
+ trim_trailing_whitespace = true
13
13
14
14
# New line preferences
15
15
end_of_line = unset
16
16
insert_final_newline = unset
17
17
18
+ dotnet_style_null_propagation = true :suggestion
19
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
20
+ dotnet_style_prefer_auto_properties = true :suggestion
21
+ dotnet_style_operator_placement_when_wrapping = beginning_of_line
22
+ dotnet_style_object_initializer = true :suggestion
23
+ dotnet_style_coalesce_expression = true :suggestion
24
+ dotnet_style_collection_initializer = true :suggestion
25
+ dotnet_style_prefer_simplified_boolean_expressions = true :suggestion
26
+ dotnet_style_prefer_conditional_expression_over_assignment = false :silent
27
+ dotnet_style_prefer_conditional_expression_over_return = false :silent
28
+ dotnet_style_explicit_tuple_names = true :suggestion
29
+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
30
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
31
+ dotnet_style_prefer_compound_assignment = true :suggestion
32
+ dotnet_style_prefer_simplified_interpolation = true :suggestion
33
+ dotnet_style_namespace_match_folder = false :silent
34
+ dotnet_style_readonly_field = true :suggestion
35
+ dotnet_style_predefined_type_for_locals_parameters_members = true :silent
36
+ dotnet_style_predefined_type_for_member_access = true :silent
37
+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
38
+ dotnet_style_allow_multiple_blank_lines_experimental = false :error
39
+ dotnet_style_allow_statement_immediately_after_block_experimental = false :error
40
+ dotnet_code_quality_unused_parameters = all:suggestion
41
+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
42
+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
43
+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
44
+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
45
+ dotnet_style_qualification_for_event = false :silent
46
+ dotnet_style_qualification_for_method = false :silent
47
+ dotnet_style_qualification_for_property = false :silent
48
+ dotnet_style_qualification_for_field = false :silent
49
+
50
+ # C# files
51
+ [* .cs ]
52
+
18
53
# ### .NET Coding Conventions ####
19
54
20
55
# Organize usings
@@ -42,21 +77,10 @@ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:sil
42
77
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
43
78
44
79
# Expression-level preferences
45
- dotnet_style_coalesce_expression = true :suggestion
46
- dotnet_style_collection_initializer = true :suggestion
47
- dotnet_style_explicit_tuple_names = true :suggestion
48
- dotnet_style_null_propagation = true :suggestion
49
- dotnet_style_object_initializer = true :suggestion
50
- dotnet_style_operator_placement_when_wrapping = beginning_of_line
51
- dotnet_style_prefer_auto_properties = true :silent
52
- dotnet_style_prefer_compound_assignment = true :suggestion
53
- dotnet_style_prefer_conditional_expression_over_assignment = true :silent
54
- dotnet_style_prefer_conditional_expression_over_return = true :silent
55
- dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
56
- dotnet_style_prefer_inferred_tuple_names = true :suggestion
57
- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
58
- dotnet_style_prefer_simplified_boolean_expressions = true :suggestion
59
- dotnet_style_prefer_simplified_interpolation = true :suggestion
80
+ csharp_style_prefer_local_over_anonymous_function = true :silent
81
+ csharp_style_prefer_extended_property_pattern = true :suggestion
82
+ csharp_style_implicit_object_creation_when_type_is_apparent = true :silent
83
+ csharp_style_prefer_tuple_swap = true :silent
60
84
61
85
# Field preferences
62
86
dotnet_style_readonly_field = true :suggestion
@@ -70,29 +94,31 @@ dotnet_remove_unnecessary_suppression_exclusions = none
70
94
# ### C# Coding Conventions ####
71
95
72
96
# var preferences
73
- csharp_style_var_elsewhere = true :silent
74
- csharp_style_var_for_built_in_types = true :silent
75
- csharp_style_var_when_type_is_apparent = true :silent
97
+ csharp_style_var_elsewhere = true :suggestion
98
+ csharp_style_var_for_built_in_types = true :suggestion
99
+ csharp_style_var_when_type_is_apparent = true :suggestion
76
100
77
101
# Expression-bodied members
78
102
csharp_style_expression_bodied_accessors = true :silent
79
103
csharp_style_expression_bodied_constructors = false :silent
80
104
csharp_style_expression_bodied_indexers = true :silent
81
105
csharp_style_expression_bodied_lambdas = true :silent
82
106
csharp_style_expression_bodied_local_functions = true :silent
83
- csharp_style_expression_bodied_methods =when_on_single_line:silent
84
- csharp_style_expression_bodied_operators =true :silent
107
+ csharp_style_expression_bodied_methods = when_on_single_line:silent
108
+ csharp_style_expression_bodied_operators = true :silent
85
109
csharp_style_expression_bodied_properties = true :silent
86
110
87
111
# Pattern matching preferences
88
112
csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
89
113
csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
90
114
csharp_style_prefer_not_pattern = true :suggestion
91
- csharp_style_prefer_pattern_matching = true :silent
115
+ csharp_style_prefer_pattern_matching = true :suggestion
92
116
csharp_style_prefer_switch_expression = true :suggestion
93
117
94
118
# Null-checking preferences
95
119
csharp_style_conditional_delegate_call = true :suggestion
120
+ csharp_style_prefer_parameter_null_checking = true :suggestion
121
+ csharp_style_prefer_null_check_over_type_check = true :suggestion
96
122
97
123
# Modifier preferences
98
124
csharp_prefer_static_local_function = true :suggestion
@@ -102,6 +128,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter
102
128
csharp_prefer_braces = true :silent
103
129
csharp_prefer_simple_using_statement = true :suggestion
104
130
csharp_style_namespace_declarations = file_scoped:suggestion
131
+ csharp_style_prefer_method_group_conversion = true :silent
105
132
106
133
# Expression-level preferences
107
134
csharp_prefer_simple_default_expression = true :suggestion
@@ -127,6 +154,9 @@ csharp_new_line_before_members_in_anonymous_types = true
127
154
csharp_new_line_before_members_in_object_initializers = true
128
155
csharp_new_line_before_open_brace = all
129
156
csharp_new_line_between_query_expression_clauses = true
157
+ csharp_style_allow_embedded_statements_on_same_line_experimental = false :error
158
+ csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false :error
159
+ csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true :silent
130
160
131
161
# Indentation preferences
132
162
csharp_indent_block_contents = true
0 commit comments