1
- # Note: MSAL rules used as a starting point
2
-
3
1
# editorconfig.org
4
- # Copied from the .NET Core repo https://github.com/dotnet/corefx/blob/master/.editorconfig
5
2
6
3
# top-most EditorConfig file
7
4
root = true
@@ -13,7 +10,7 @@ root = true
13
10
insert_final_newline = true
14
11
indent_style = space
15
12
indent_size = 4
16
- dotnet_diagnostic.CA1308.severity = warning
13
+ trim_trailing_whitespace = true
17
14
18
15
[project.json ]
19
16
indent_size = 2
@@ -33,6 +30,7 @@ csharp_new_line_between_query_expression_clauses = true
33
30
csharp_indent_block_contents = true
34
31
csharp_indent_braces = false
35
32
csharp_indent_case_contents = true
33
+ csharp_indent_case_contents_when_block = true
36
34
csharp_indent_switch_labels = true
37
35
csharp_indent_labels = one_less_than_current
38
36
@@ -84,24 +82,42 @@ dotnet_naming_style.camel_case_underscore_style.required_prefix = _
84
82
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
85
83
86
84
# Code style defaults
85
+ csharp_using_directive_placement = outside_namespace:suggestion
87
86
dotnet_sort_system_directives_first = true
88
- csharp_preserve_single_line_blocks = true
89
- csharp_preserve_single_line_statements = false
87
+ csharp_prefer_braces = true :silent
88
+ csharp_preserve_single_line_blocks = true :none
89
+ csharp_preserve_single_line_statements = false :none
90
+ csharp_prefer_static_local_function = true :suggestion
91
+ csharp_prefer_simple_using_statement = false :none
92
+ csharp_style_prefer_switch_expression = true :suggestion
93
+
94
+ # Code quality
95
+ dotnet_style_readonly_field = true :suggestion
96
+ dotnet_code_quality_unused_parameters = non_public:suggestion
90
97
91
98
# Expression-level preferences
92
99
dotnet_style_object_initializer = true :suggestion
93
100
dotnet_style_collection_initializer = true :suggestion
94
101
dotnet_style_explicit_tuple_names = true :suggestion
95
102
dotnet_style_coalesce_expression = true :suggestion
96
103
dotnet_style_null_propagation = true :suggestion
104
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
105
+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
106
+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
107
+ dotnet_style_prefer_auto_properties = true :suggestion
108
+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
109
+ dotnet_style_prefer_conditional_expression_over_return = true :silent
110
+ csharp_prefer_simple_default_expression = true :suggestion
97
111
98
112
# Expression-bodied members
99
- csharp_style_expression_bodied_methods = false :none
100
- csharp_style_expression_bodied_constructors = false :none
101
- csharp_style_expression_bodied_operators = false :none
102
- csharp_style_expression_bodied_properties = true :none
103
- csharp_style_expression_bodied_indexers = true :none
104
- csharp_style_expression_bodied_accessors = true :none
113
+ csharp_style_expression_bodied_methods = true :silent
114
+ csharp_style_expression_bodied_constructors = true :silent
115
+ csharp_style_expression_bodied_operators = true :silent
116
+ csharp_style_expression_bodied_properties = true :silent
117
+ csharp_style_expression_bodied_indexers = true :silent
118
+ csharp_style_expression_bodied_accessors = true :silent
119
+ csharp_style_expression_bodied_lambdas = true :silent
120
+ csharp_style_expression_bodied_local_functions = true :silent
105
121
106
122
# Pattern matching
107
123
csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
@@ -112,6 +128,11 @@ csharp_style_inlined_variable_declaration = true:suggestion
112
128
csharp_style_throw_expression = true :suggestion
113
129
csharp_style_conditional_delegate_call = true :suggestion
114
130
131
+ # Other features
132
+ csharp_style_prefer_index_operator = false :none
133
+ csharp_style_prefer_range_operator = false :none
134
+ csharp_style_pattern_local_over_anonymous_function = false :none
135
+
115
136
# Space preferences
116
137
csharp_space_after_cast = false
117
138
csharp_space_after_colon_in_inheritance_clause = true
@@ -136,6 +157,10 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
136
157
csharp_space_between_parentheses = false
137
158
csharp_space_between_square_brackets = false
138
159
160
+ # Analyzers
161
+ dotnet_code_quality.CA1802.api_surface = private, internal
162
+ dotnet_code_quality.CA2208.api_surface = public
163
+
139
164
# Id Web Rules
140
165
141
166
# RS0030: Do not used banned APIs
@@ -238,6 +263,9 @@ dotnet_diagnostic.CA1067.severity = error
238
263
# CA1068: CancellationToken parameters must come last
239
264
dotnet_diagnostic.CA1068.severity = error
240
265
266
+ # CA1308: Normalize strings to uppercase
267
+ dotnet_diagnostic.CA1308.severity =warning
268
+
241
269
# CA1505: Avoid unmaintainable code
242
270
dotnet_diagnostic.CA1505.severity = error
243
271
@@ -558,6 +586,9 @@ indent_brace_style = Allman
558
586
[* .{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj} ]
559
587
indent_size = 2
560
588
589
+ [* .{csproj,vbproj,proj,nativeproj,locproj} ]
590
+ charset = utf-8
591
+
561
592
# Xml build files
562
593
[* .builds ]
563
594
indent_size = 2
0 commit comments