44# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options
55
66# .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
88
99# 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
1111
1212# 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
1414
1515# .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
1717
1818# Top-most EditorConfig file
1919root = true
@@ -26,6 +26,9 @@ indent_style = space
2626indent_size = 2
2727trim_trailing_whitespace = true
2828
29+ [* .json ]
30+ insert_final_newline = false
31+
2932[* .cs ]
3033indent_size = 4
3134
@@ -91,8 +94,8 @@ csharp_style_var_elsewhere = true:suggestion
9194
9295# C# code style settings - Expression-bodied members
9396# 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
9699csharp_style_expression_bodied_operators = when_on_single_line:warning
97100csharp_style_expression_bodied_properties = when_on_single_line:warning
98101csharp_style_expression_bodied_indexers = when_on_single_line:warning
@@ -120,7 +123,7 @@ csharp_style_conditional_delegate_call = true:warning
120123
121124# C# code style settings - Code block preferences
122125# 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
124127
125128# C# code style - Unused value preferences
126129# 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
129132
130133# C# code style - Index and range preferences
131134# 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
134137
135138# C# code style - Miscellaneous preferences
136139# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#miscellaneous-preferences
137140csharp_style_deconstructed_variable_declaration = true :suggestion
138141csharp_style_pattern_local_over_anonymous_function = true :suggestion
139142csharp_using_directive_placement = outside_namespace:warning
140143csharp_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
143146
144147# .NET formatting settings - Organize using directives
145148# 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
260263
261264# ReSharper: Configure await
262265configure_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