4
4
# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options
5
5
6
6
# .NET coding convention settings for EditorConfig
7
- # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019
7
+ # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
8
8
9
9
# Language conventions
10
- # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019
10
+ # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions
11
11
12
12
# Formatting conventions
13
- # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-formatting-conventions?view=vs-2019
13
+ # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-formatting-conventions
14
14
15
15
# .NET naming conventions for EditorConfig
16
- # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2019
16
+ # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions
17
17
18
18
# Top-most EditorConfig file
19
19
root = true
@@ -26,6 +26,9 @@ indent_style = space
26
26
indent_size = 2
27
27
trim_trailing_whitespace = true
28
28
29
+ [* .json ]
30
+ insert_final_newline = false
31
+
29
32
[* .cs ]
30
33
indent_size = 4
31
34
@@ -91,8 +94,8 @@ csharp_style_var_elsewhere = true:suggestion
91
94
92
95
# C# code style settings - Expression-bodied members
93
96
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#expression-bodied-members
94
- csharp_style_expression_bodied_methods = when_on_single_line:warning
95
- csharp_style_expression_bodied_constructors = false :suggestion
97
+ csharp_style_expression_bodied_methods = when_on_single_line:suggestion
98
+ csharp_style_expression_bodied_constructors = false :warning
96
99
csharp_style_expression_bodied_operators = when_on_single_line:warning
97
100
csharp_style_expression_bodied_properties = when_on_single_line:warning
98
101
csharp_style_expression_bodied_indexers = when_on_single_line:warning
@@ -120,7 +123,7 @@ csharp_style_conditional_delegate_call = true:warning
120
123
121
124
# C# code style settings - Code block preferences
122
125
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#code-block-preferences
123
- csharp_prefer_braces = false :suggestion
126
+ csharp_prefer_braces = when_multiline :suggestion
124
127
125
128
# C# code style - Unused value preferences
126
129
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#unused-value-preferences
@@ -129,17 +132,17 @@ csharp_style_unused_value_assignment_preference = discard_variable:suggestion
129
132
130
133
# C# code style - Index and range preferences
131
134
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#index-and-range-preferences
132
- csharp_style_prefer_index_operator = true :warning
133
- csharp_style_prefer_range_operator = true :warning
135
+ csharp_style_prefer_index_operator = true :suggestion
136
+ csharp_style_prefer_range_operator = true :suggestion
134
137
135
138
# C# code style - Miscellaneous preferences
136
139
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#miscellaneous-preferences
137
140
csharp_style_deconstructed_variable_declaration = true :suggestion
138
141
csharp_style_pattern_local_over_anonymous_function = true :suggestion
139
142
csharp_using_directive_placement = outside_namespace:warning
140
143
csharp_prefer_static_local_function = true :suggestion
141
- csharp_prefer_simple_using_statement = false : suggestion
142
- csharp_style_prefer_switch_expression = true :suggestion
144
+ csharp_prefer_simple_using_statement = true : warning
145
+ csharp_style_prefer_switch_expression = true :warning
143
146
144
147
# .NET formatting settings - Organize using directives
145
148
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-formatting-conventions?view=vs-2019#organize-using-directives
@@ -260,3 +263,27 @@ dotnet_naming_rule.async_methods_end_in_async.severity = warning
260
263
261
264
# ReSharper: Configure await
262
265
configure_await_analysis_mode = library
266
+
267
+ # Remove unnecessary import https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
268
+ dotnet_diagnostic.IDE0005.severity = error
269
+
270
+ # Enforce formatting https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#rule-id-ide0055-fix-formatting
271
+ dotnet_diagnostic.IDE0055.severity = error
272
+
273
+ # https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS0060.md
274
+ dotnet_diagnostic.RCS0060.severity = warning
275
+ roslynator_blank_line_after_file_scoped_namespace_declaration = true
276
+
277
+ # https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1080.md
278
+ dotnet_diagnostic.RCS1080.severity = warning
279
+
280
+ # ConfigureAwait https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1090.md
281
+ dotnet_diagnostic.RCS1090.severity = warning
282
+ roslynator_configure_await = true
283
+
284
+ # https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1102.md
285
+ # TODO: NullabilityInfo issue in Patching.cs in internal class SR
286
+ dotnet_diagnostic.RCS1102.severity = suggestion
287
+
288
+ # https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1194.md
289
+ dotnet_diagnostic.RCS1194.severity = suggestion
0 commit comments