|  | 
|  | 1 | +# Remove the line below if you want to inherit .editorconfig settings from higher directories | 
|  | 2 | +root = true | 
|  | 3 | + | 
|  | 4 | +# C# files | 
|  | 5 | +[*.cs] | 
|  | 6 | + | 
|  | 7 | +#### Core EditorConfig Options #### | 
|  | 8 | +csharp_style_unused_value_assignment_preference = false:none | 
|  | 9 | +csharp_style_unused_value_expression_statement_preference = false:none | 
|  | 10 | + | 
|  | 11 | +dotnet_diagnostic.IDE0090.severity = none | 
|  | 12 | +csharp_style_namespace_declarations = file_scoped | 
|  | 13 | +dotnet_analyzer_diagnostic.severity = suggestion | 
|  | 14 | + | 
|  | 15 | +# Prefer "var" everywhere | 
|  | 16 | +csharp_style_var_for_built_in_types = false:warning | 
|  | 17 | +csharp_style_var_when_type_is_apparent = false:warning | 
|  | 18 | +csharp_style_var_elsewhere = false:warning | 
|  | 19 | + | 
|  | 20 | +# IDE0055: Fix formatting | 
|  | 21 | +dotnet_diagnostic.IDE0055.severity = warning | 
|  | 22 | + | 
|  | 23 | +# Sort using and Import directives with System.* appearing first | 
|  | 24 | +dotnet_sort_system_directives_first = true | 
|  | 25 | +dotnet_separate_import_directive_groups = false | 
|  | 26 | +# Avoid "this." and "Me." if not necessary | 
|  | 27 | +dotnet_style_qualification_for_field = false:refactoring | 
|  | 28 | +dotnet_style_qualification_for_property = false:refactoring | 
|  | 29 | +dotnet_style_qualification_for_method = false:refactoring | 
|  | 30 | +dotnet_style_qualification_for_event = false:refactoring | 
|  | 31 | + | 
|  | 32 | +# Use language keywords instead of framework type names for type references | 
|  | 33 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion | 
|  | 34 | +dotnet_style_predefined_type_for_member_access = true:suggestion | 
|  | 35 | + | 
|  | 36 | +# Suggest more modern language features when available | 
|  | 37 | +dotnet_style_object_initializer = true:suggestion | 
|  | 38 | +dotnet_style_collection_initializer = true:suggestion | 
|  | 39 | +dotnet_style_coalesce_expression = true:suggestion | 
|  | 40 | +dotnet_style_null_propagation = true:suggestion | 
|  | 41 | +dotnet_style_explicit_tuple_names = true:suggestion | 
|  | 42 | + | 
|  | 43 | +# Whitespace options | 
|  | 44 | +dotnet_style_allow_multiple_blank_lines_experimental = false | 
|  | 45 | + | 
|  | 46 | +# Non-private static fields are PascalCase | 
|  | 47 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion | 
|  | 48 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields | 
|  | 49 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style | 
|  | 50 | + | 
|  | 51 | +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field | 
|  | 52 | +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected | 
|  | 53 | +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static | 
|  | 54 | + | 
|  | 55 | +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case | 
|  | 56 | + | 
|  | 57 | +# Non-private readonly fields are PascalCase | 
|  | 58 | +dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion | 
|  | 59 | +dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields | 
|  | 60 | +dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style | 
|  | 61 | + | 
|  | 62 | +dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field | 
|  | 63 | +dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected | 
|  | 64 | +dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly | 
|  | 65 | + | 
|  | 66 | +dotnet_naming_style.non_private_readonly_field_style.capitalization = camel_case | 
|  | 67 | + | 
|  | 68 | +# Constants are PascalCase | 
|  | 69 | +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion | 
|  | 70 | +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants | 
|  | 71 | +dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style | 
|  | 72 | + | 
|  | 73 | +dotnet_naming_symbols.constants.applicable_kinds = field, local | 
|  | 74 | +dotnet_naming_symbols.constants.required_modifiers = const | 
|  | 75 | + | 
|  | 76 | +dotnet_naming_style.constant_style.capitalization = pascal_case | 
|  | 77 | + | 
|  | 78 | +# Static fields are camelCase and start with s_ | 
|  | 79 | +dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion | 
|  | 80 | +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields | 
|  | 81 | +dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style | 
|  | 82 | + | 
|  | 83 | +dotnet_naming_symbols.static_fields.applicable_kinds = field | 
|  | 84 | +dotnet_naming_symbols.static_fields.required_modifiers = static | 
|  | 85 | + | 
|  | 86 | +dotnet_naming_style.static_field_style.capitalization = camel_case | 
|  | 87 | + | 
|  | 88 | +# Instance fields are camelCase and start with _ | 
|  | 89 | +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion | 
|  | 90 | +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields | 
|  | 91 | +dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style | 
|  | 92 | + | 
|  | 93 | +dotnet_naming_symbols.instance_fields.applicable_kinds = field | 
|  | 94 | + | 
|  | 95 | +dotnet_naming_style.instance_field_style.capitalization = camel_case | 
|  | 96 | + | 
|  | 97 | +# Locals and parameters are camelCase | 
|  | 98 | +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion | 
|  | 99 | +dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters | 
|  | 100 | +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style | 
|  | 101 | + | 
|  | 102 | +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local | 
|  | 103 | + | 
|  | 104 | +dotnet_naming_style.camel_case_style.capitalization = camel_case | 
|  | 105 | + | 
|  | 106 | +# Local functions are PascalCase | 
|  | 107 | +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion | 
|  | 108 | +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions | 
|  | 109 | +dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style | 
|  | 110 | + | 
|  | 111 | +dotnet_naming_symbols.local_functions.applicable_kinds = local_function | 
|  | 112 | + | 
|  | 113 | +dotnet_naming_style.local_function_style.capitalization = pascal_case | 
|  | 114 | + | 
|  | 115 | +# By default, name items with PascalCase | 
|  | 116 | +dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion | 
|  | 117 | +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members | 
|  | 118 | +dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style | 
|  | 119 | + | 
|  | 120 | +dotnet_naming_symbols.all_members.applicable_kinds = * | 
|  | 121 | + | 
|  | 122 | +dotnet_naming_style.pascal_case_style.capitalization = pascal_case | 
|  | 123 | + | 
|  | 124 | +# error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}' | 
|  | 125 | +dotnet_diagnostic.RS2008.severity = suggestion | 
|  | 126 | + | 
|  | 127 | +# IDE0073: File header | 
|  | 128 | +# dotnet_diagnostic.IDE0073.severity = warning | 
|  | 129 | +# file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information. | 
|  | 130 | + | 
|  | 131 | +# IDE0035: Remove unreachable code | 
|  | 132 | +dotnet_diagnostic.IDE0035.severity = warning | 
|  | 133 | + | 
|  | 134 | +# IDE0046: | 
|  | 135 | +dotnet_diagnostic.IDE0046.severity = none | 
|  | 136 | + | 
|  | 137 | +# IDE0036: Order modifiers | 
|  | 138 | +dotnet_diagnostic.IDE0036.severity = warning | 
|  | 139 | + | 
|  | 140 | +# IDE0043: Format string contains invalid placeholder | 
|  | 141 | +dotnet_diagnostic.IDE0043.severity = warning | 
|  | 142 | + | 
|  | 143 | +# IDE0044: Make field readonly | 
|  | 144 | +dotnet_diagnostic.IDE0044.severity = warning | 
|  | 145 | + | 
|  | 146 | +# RS0016: Only enable if API files are present | 
|  | 147 | +dotnet_public_api_analyzer.require_api_files = true | 
|  | 148 | + | 
|  | 149 | +# Newline settings | 
|  | 150 | +csharp_new_line_before_open_brace = all | 
|  | 151 | +csharp_new_line_before_else = true | 
|  | 152 | +csharp_new_line_before_catch = true | 
|  | 153 | +csharp_new_line_before_finally = true | 
|  | 154 | +csharp_new_line_before_members_in_object_initializers = true | 
|  | 155 | +csharp_new_line_before_members_in_anonymous_types = true | 
|  | 156 | +csharp_new_line_between_query_expression_clauses = true | 
|  | 157 | + | 
|  | 158 | +# Indentation preferences | 
|  | 159 | +csharp_indent_block_contents = true | 
|  | 160 | +csharp_indent_braces = false | 
|  | 161 | +csharp_indent_case_contents = true | 
|  | 162 | +csharp_indent_case_contents_when_block = true | 
|  | 163 | +csharp_indent_switch_labels = true | 
|  | 164 | +csharp_indent_labels = flush_left | 
|  | 165 | + | 
|  | 166 | +# Whitespace options | 
|  | 167 | +csharp_style_allow_embedded_statements_on_same_line_experimental = false | 
|  | 168 | +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false | 
|  | 169 | +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false | 
|  | 170 | + | 
|  | 171 | +# Prefer method-like constructs to have a block body | 
|  | 172 | +csharp_style_expression_bodied_methods = false:suggestion | 
|  | 173 | +csharp_style_expression_bodied_constructors = false:suggestion | 
|  | 174 | +csharp_style_expression_bodied_operators = false:suggestion | 
|  | 175 | + | 
|  | 176 | +# Prefer property-like constructs to have an expression-body | 
|  | 177 | +csharp_style_expression_bodied_properties = true:suggestion | 
|  | 178 | +csharp_style_expression_bodied_indexers = true:suggestion | 
|  | 179 | +csharp_style_expression_bodied_accessors = true:suggestion | 
|  | 180 | + | 
|  | 181 | +# Suggest more modern language features when available | 
|  | 182 | +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion | 
|  | 183 | +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion | 
|  | 184 | +csharp_style_inlined_variable_declaration = true:suggestion | 
|  | 185 | +csharp_style_throw_expression = true:suggestion | 
|  | 186 | +csharp_style_conditional_delegate_call = true:suggestion | 
|  | 187 | + | 
|  | 188 | +# Space preferences | 
|  | 189 | +csharp_space_after_cast = false | 
|  | 190 | +csharp_space_after_colon_in_inheritance_clause = true | 
|  | 191 | +csharp_space_after_comma = true | 
|  | 192 | +csharp_space_after_dot = false | 
|  | 193 | +csharp_space_after_keywords_in_control_flow_statements = true | 
|  | 194 | +csharp_space_after_semicolon_in_for_statement = true | 
|  | 195 | +csharp_space_around_binary_operators = before_and_after | 
|  | 196 | +csharp_space_around_declaration_statements = do_not_ignore | 
|  | 197 | +csharp_space_before_colon_in_inheritance_clause = true | 
|  | 198 | +csharp_space_before_comma = false | 
|  | 199 | +csharp_space_before_dot = false | 
|  | 200 | +csharp_space_before_open_square_brackets = false | 
|  | 201 | +csharp_space_before_semicolon_in_for_statement = false | 
|  | 202 | +csharp_space_between_empty_square_brackets = false | 
|  | 203 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false | 
|  | 204 | +csharp_space_between_method_call_name_and_opening_parenthesis = false | 
|  | 205 | +csharp_space_between_method_call_parameter_list_parentheses = false | 
|  | 206 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false | 
|  | 207 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false | 
|  | 208 | +csharp_space_between_method_declaration_parameter_list_parentheses = false | 
|  | 209 | +csharp_space_between_parentheses = false | 
|  | 210 | +csharp_space_between_square_brackets = false | 
|  | 211 | + | 
|  | 212 | +# Blocks are allowed | 
|  | 213 | +csharp_prefer_braces = true:silent | 
|  | 214 | +csharp_preserve_single_line_blocks = true | 
|  | 215 | +csharp_preserve_single_line_statements = true | 
|  | 216 | + | 
|  | 217 | +# Currently only enabled for C# due to crash in VB analyzer.  VB can be enabled once | 
|  | 218 | +# https://github.com/dotnet/roslyn/pull/54259 has been published. | 
|  | 219 | +dotnet_style_allow_statement_immediately_after_block_experimental = false | 
|  | 220 | + | 
|  | 221 | +# warning RS0005: Do not use generic CodeAction.Create to create CodeAction | 
|  | 222 | +dotnet_diagnostic.RS0005.severity = suggestion | 
|  | 223 | + | 
|  | 224 | +# IDE0011: Add braces | 
|  | 225 | +csharp_prefer_braces = when_multiline:warning | 
|  | 226 | +# NOTE: We need the below severity entry for Add Braces due to https://github.com/dotnet/roslyn/issues/44201 | 
|  | 227 | +dotnet_diagnostic.IDE0011.severity = warning | 
|  | 228 | + | 
|  | 229 | +# IDE0040: Add accessibility modifiers | 
|  | 230 | +dotnet_diagnostic.IDE0040.severity = warning | 
|  | 231 | + | 
|  | 232 | +# CONSIDER: Are IDE0051 and IDE0052 too noisy to be warnings for IDE editing scenarios? Should they be made build-only warnings? | 
|  | 233 | +# IDE0051: Remove unused private member | 
|  | 234 | +dotnet_diagnostic.IDE0051.severity = none | 
|  | 235 | + | 
|  | 236 | +# IDE0052: Remove unread private member | 
|  | 237 | +dotnet_diagnostic.IDE0052.severity = warning | 
|  | 238 | + | 
|  | 239 | +# IDE0059: Unnecessary assignment to a value | 
|  | 240 | +dotnet_diagnostic.IDE0059.severity = warning | 
|  | 241 | + | 
|  | 242 | +# IDE0060: Remove unused parameter | 
|  | 243 | +dotnet_diagnostic.IDE0060.severity = suggestion | 
|  | 244 | + | 
|  | 245 | +# CA1012: Abstract types should not have public constructors | 
|  | 246 | +dotnet_diagnostic.CA1012.severity = warning | 
|  | 247 | + | 
|  | 248 | +# CA1822: Make member static | 
|  | 249 | +dotnet_diagnostic.CA1822.severity = warning | 
|  | 250 | + | 
|  | 251 | +# dotnet_style_allow_multiple_blank_lines_experimental | 
|  | 252 | +dotnet_diagnostic.IDE2000.severity = warning | 
|  | 253 | + | 
|  | 254 | +# csharp_style_allow_embedded_statements_on_same_line_experimental | 
|  | 255 | +dotnet_diagnostic.IDE2001.severity = warning | 
|  | 256 | + | 
|  | 257 | +# csharp_style_allow_blank_lines_between_consecutive_braces_experimental | 
|  | 258 | +dotnet_diagnostic.IDE2002.severity = warning | 
|  | 259 | + | 
|  | 260 | +# dotnet_style_allow_statement_immediately_after_block_experimental | 
|  | 261 | +dotnet_diagnostic.IDE2003.severity = warning | 
|  | 262 | + | 
|  | 263 | +# csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental | 
|  | 264 | +dotnet_diagnostic.IDE2004.severity = warning | 
|  | 265 | + | 
|  | 266 | +# CA1822: Make member static | 
|  | 267 | +# Not enforced as a build 'warning' for 'VisualStudio' layer due to large number of false positives from https://github.com/dotnet/roslyn-analyzers/issues/3857 and https://github.com/dotnet/roslyn-analyzers/issues/3858 | 
|  | 268 | +# Additionally, there is a risk of accidentally breaking an internal API that partners rely on though IVT. | 
|  | 269 | +dotnet_diagnostic.CA1822.severity = suggestion | 
0 commit comments