############################### # Core EditorConfig Options # ############################### root = true # All files [*] indent_style = space # XML project files [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] indent_size = 2 # XML config files [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] indent_size = 2 # Code files [*.{cs,csx,vb,vbx}] indent_size = 4 insert_final_newline = true charset = utf-8-bom ############################### # .NET Coding Conventions # ############################### [*.{cs,vb}] # Organize usings dotnet_sort_system_directives_first = true # this. preferences dotnet_style_qualification_for_field = false:silent dotnet_style_qualification_for_property = false:silent dotnet_style_qualification_for_method = false:silent dotnet_style_qualification_for_event = false:silent # Language keywords vs BCL types preferences dotnet_style_predefined_type_for_locals_parameters_members = true:silent dotnet_style_predefined_type_for_member_access = true:silent # Parentheses preferences dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning # Modifier preferences dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent dotnet_style_readonly_field = true:warning # Expression-level preferences dotnet_style_object_initializer = true:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_explicit_tuple_names = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_coalesce_expression = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_auto_properties = true:silent dotnet_style_prefer_conditional_expression_over_assignment = true:silent dotnet_style_prefer_conditional_expression_over_return = true:silent ############################### # Naming Conventions # ############################### # Style Definitions dotnet_naming_style.pascal_case_style.capitalization = pascal_case # Use PascalCase for constant fields dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style dotnet_naming_symbols.constant_fields.applicable_kinds = field dotnet_naming_symbols.constant_fields.applicable_accessibilities = * dotnet_naming_symbols.constant_fields.required_modifiers = const dotnet_style_operator_placement_when_wrapping = beginning_of_line tab_width = 4 end_of_line = crlf dotnet_diagnostic.CA2100.severity = error dotnet_style_prefer_simplified_boolean_expressions = true:warning dotnet_style_prefer_compound_assignment = true:suggestion dotnet_style_prefer_simplified_interpolation = true:suggestion dotnet_style_namespace_match_folder = true:suggestion dotnet_style_allow_multiple_blank_lines_experimental = true:silent dotnet_style_allow_statement_immediately_after_block_experimental = true:silent dotnet_code_quality_unused_parameters = all:warning ############################### # C# Coding Conventions # ############################### [*.cs] # var preferences csharp_style_var_for_built_in_types = false:error csharp_style_var_when_type_is_apparent = true:silent csharp_style_var_elsewhere = true:silent # Expression-bodied members csharp_style_expression_bodied_methods = false:silent csharp_style_expression_bodied_constructors = false:silent csharp_style_expression_bodied_operators = false:silent csharp_style_expression_bodied_properties = true:silent csharp_style_expression_bodied_indexers = true:silent csharp_style_expression_bodied_accessors = true:silent # Pattern matching preferences csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion csharp_style_pattern_matching_over_as_with_null_check = true:suggestion # Null-checking preferences csharp_style_throw_expression = true:suggestion csharp_style_conditional_delegate_call = true:suggestion # Modifier preferences csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion # Expression-level preferences csharp_prefer_braces = true:suggestion csharp_style_deconstructed_variable_declaration = true:suggestion csharp_prefer_simple_default_expression = true:suggestion csharp_style_prefer_local_over_anonymous_function = true:warning csharp_style_inlined_variable_declaration = true:warning ############################### # C# Formatting Rules # ############################### # New line preferences csharp_new_line_before_open_brace = all csharp_new_line_before_else = true csharp_new_line_before_catch = true csharp_new_line_before_finally = true csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_anonymous_types = true csharp_new_line_between_query_expression_clauses = true # Indentation preferences csharp_indent_case_contents = true csharp_indent_switch_labels = true csharp_indent_labels = flush_left # Space preferences csharp_space_after_cast = false csharp_space_after_keywords_in_control_flow_statements = true csharp_space_between_method_call_parameter_list_parentheses = false csharp_space_between_method_declaration_parameter_list_parentheses = false csharp_space_between_parentheses = false csharp_space_before_colon_in_inheritance_clause = true csharp_space_after_colon_in_inheritance_clause = true csharp_space_around_binary_operators = before_and_after csharp_space_between_method_declaration_empty_parameter_list_parentheses = false csharp_space_between_method_call_name_and_opening_parenthesis = false csharp_space_between_method_call_empty_parameter_list_parentheses = false # Wrapping preferences csharp_preserve_single_line_statements = true csharp_preserve_single_line_blocks = true csharp_using_directive_placement = outside_namespace:silent csharp_style_namespace_declarations = file_scoped:none csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_top_level_statements = true:silent csharp_style_expression_bodied_lambdas = true:silent csharp_style_expression_bodied_local_functions = false:silent csharp_style_prefer_null_check_over_type_check = true:suggestion csharp_style_prefer_index_operator = true:suggestion csharp_style_prefer_range_operator = true:suggestion csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion csharp_style_prefer_tuple_swap = true:suggestion csharp_style_prefer_utf8_string_literals = true:suggestion csharp_style_unused_value_assignment_preference = discard_variable:error csharp_style_unused_value_expression_statement_preference = discard_variable:silent csharp_prefer_static_local_function = true:suggestion csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent csharp_style_prefer_switch_expression = true:suggestion csharp_style_prefer_pattern_matching = true:silent csharp_style_prefer_not_pattern = true:suggestion csharp_style_prefer_extended_property_pattern = true:suggestion csharp_indent_case_contents_when_block = true csharp_style_prefer_primary_constructors = true:suggestion csharp_style_prefer_simple_using_statement = true:suggestion ############################### # ANALYSERS # ############################### # CS4014: Because this call is not awaited, execution of the current method continues before the call is completed dotnet_diagnostic.CS4014.severity = error # MA0004: Use .ConfigureAwait(false) dotnet_diagnostic.MA0004.severity = none # MA0006: use String.Equals dotnet_diagnostic.MA0006.severity = none dotnet_diagnostic.CA1820.severity = error # CS0168: Variable is declared but never used dotnet_diagnostic.CS0168.severity = error # IDE0161: Convert to file-scoped namespace dotnet_diagnostic.IDE0161.severity = none # IDE0011: Add braces dotnet_diagnostic.IDE0011.severity = suggestion # IDE0018: Inline variable declaration dotnet_diagnostic.IDE0018.severity = warning # IDE0042: Deconstruct variable declaration dotnet_diagnostic.IDE0042.severity = suggestion # IDE0054: Use compound assignment dotnet_diagnostic.IDE0054.severity = suggestion # IDE0044: Add readonly modifier dotnet_diagnostic.IDE0044.severity = warning # IDE0075: Simplify conditional expression dotnet_diagnostic.IDE0075.severity = warning dotnet_diagnostic.CA1047.severity = error dotnet_diagnostic.CA1008.severity = warning dotnet_diagnostic.CA1012.severity = error dotnet_diagnostic.CA1027.severity = silent dotnet_diagnostic.CA1041.severity = error dotnet_diagnostic.CA1031.severity = silent dotnet_diagnostic.CA1028.severity = silent dotnet_diagnostic.CA1051.severity = suggestion dotnet_diagnostic.CA1054.severity = warning dotnet_diagnostic.CA1063.severity = error dotnet_diagnostic.CA1065.severity = error dotnet_diagnostic.CA1069.severity = error dotnet_diagnostic.CA1304.severity = warning dotnet_diagnostic.CA1508.severity = error dotnet_diagnostic.CA1510.severity = suggestion dotnet_diagnostic.CA1700.severity = error dotnet_diagnostic.CA1708.severity = error dotnet_diagnostic.CA1711.severity = suggestion dotnet_diagnostic.CA1712.severity = error dotnet_diagnostic.CA1715.severity = none dotnet_diagnostic.CA1720.severity = none dotnet_diagnostic.CA2002.severity = error dotnet_diagnostic.CA2007.severity = none dotnet_diagnostic.CA2008.severity = silent dotnet_diagnostic.CA2011.severity = error dotnet_diagnostic.CA2012.severity = error dotnet_diagnostic.CA2119.severity = warning dotnet_diagnostic.CA2300.severity = error dotnet_diagnostic.CA2305.severity = error dotnet_diagnostic.CA2315.severity = error dotnet_diagnostic.CA2321.severity = error dotnet_diagnostic.CA3001.severity = warning dotnet_diagnostic.CA3002.severity = warning dotnet_diagnostic.CA3003.severity = warning dotnet_diagnostic.CA3004.severity = error dotnet_diagnostic.CA3005.severity = warning dotnet_diagnostic.CA3006.severity = warning dotnet_diagnostic.CA3007.severity = error dotnet_diagnostic.CA3008.severity = error dotnet_diagnostic.CA3009.severity = error dotnet_diagnostic.CA3011.severity = error dotnet_diagnostic.CA3012.severity = warning dotnet_diagnostic.CA5350.severity = warning dotnet_diagnostic.CA5351.severity = warning dotnet_diagnostic.CA5359.severity = warning dotnet_diagnostic.CA5373.severity = warning dotnet_diagnostic.CA5379.severity = warning dotnet_diagnostic.CA5395.severity = warning dotnet_diagnostic.CA2219.severity = warning dotnet_diagnostic.CA2242.severity = error dotnet_diagnostic.CA2245.severity = error dotnet_diagnostic.CA2249.severity = warning dotnet_diagnostic.CA2251.severity = warning dotnet_diagnostic.CA1806.severity = warning dotnet_diagnostic.CA1813.severity = error dotnet_diagnostic.CA1821.severity = error dotnet_diagnostic.CA1826.severity = error dotnet_diagnostic.CA1827.severity = error dotnet_diagnostic.CA1828.severity = error dotnet_diagnostic.CA1829.severity = error dotnet_diagnostic.CA1830.severity = warning dotnet_diagnostic.CA1831.severity = warning dotnet_diagnostic.CA1834.severity = error dotnet_diagnostic.CA1836.severity = error dotnet_diagnostic.CA1842.severity = warning dotnet_diagnostic.CA1843.severity = warning dotnet_diagnostic.CA1846.severity = warning dotnet_diagnostic.CA1847.severity = error dotnet_diagnostic.CA1802.severity = error dotnet_diagnostic.CA1805.severity = error dotnet_diagnostic.CA1825.severity = error dotnet_diagnostic.CA1841.severity = error dotnet_diagnostic.CA1845.severity = error dotnet_diagnostic.CA1001.severity = warning dotnet_diagnostic.CA1507.severity = warning dotnet_diagnostic.CA1721.severity = warning dotnet_diagnostic.CA1724.severity = suggestion dotnet_diagnostic.CA1822.severity = suggestion dotnet_diagnostic.CA1823.severity = warning dotnet_diagnostic.CA1851.severity = warning dotnet_diagnostic.CA1853.severity = error dotnet_diagnostic.CA1854.severity = warning dotnet_diagnostic.CA1858.severity = error dotnet_diagnostic.CA1859.severity = warning dotnet_diagnostic.CA1860.severity = error dotnet_diagnostic.CA1861.severity = error dotnet_diagnostic.CA1864.severity = error dotnet_diagnostic.CA2021.severity = warning dotnet_diagnostic.CA1865.severity = suggestion dotnet_diagnostic.CA1868.severity = error # RCS1097: Remove redundant 'ToString' call. dotnet_diagnostic.RCS1097.severity = error # RCS1161: Enum should declare explicit values. dotnet_diagnostic.RCS1161.severity = error # RCS1229: Use async/await when necessary. dotnet_diagnostic.RCS1229.severity = warning # RCS1104: Simplify conditional expression. dotnet_diagnostic.RCS1104.severity = none # RCS1233: Use short-circuiting operator. dotnet_diagnostic.RCS1233.severity = error # RCS1032: Remove redundant parentheses. dotnet_diagnostic.RCS1032.severity = none # RCS1232: Order elements in documentation comment. dotnet_diagnostic.RCS1232.severity = error # RCS1163: Unused parameter. dotnet_diagnostic.RCS1163.severity = warning # RCS1246: Use element access. dotnet_diagnostic.RCS1246.severity = warning # RCS1240: Operator is unnecessary. dotnet_diagnostic.RCS1240.severity = warning # RCS1037: Remove trailing white-space. dotnet_diagnostic.RCS1037.severity = none # RCS1146: Use conditional access. dotnet_diagnostic.RCS1146.severity = warning # RCS1214: Unnecessary interpolated string. dotnet_diagnostic.RCS1214.severity = suggestion # RCS1077: Optimize LINQ method call. dotnet_diagnostic.RCS1077.severity = warning # RCS1036: Remove unnecessary blank line. dotnet_diagnostic.RCS1036.severity = silent # RCS1235: Optimize method call. dotnet_diagnostic.RCS1235.severity = warning # RCS1196: Call extension method as instance method. dotnet_diagnostic.RCS1196.severity = warning # RCS1192: Unnecessary usage of verbatim string literal. dotnet_diagnostic.RCS1192.severity = warning # RCS1058: Use compound assignment. dotnet_diagnostic.RCS1058.severity = suggestion # RCS1049: Simplify boolean comparison. dotnet_diagnostic.RCS1049.severity = error # RCS1199: Unnecessary null check. dotnet_diagnostic.RCS1199.severity = error # RCS1073: Convert 'if' to 'return' statement. dotnet_diagnostic.RCS1073.severity = none # RCS1080: Use 'Count/Length' property instead of 'Any' method. dotnet_diagnostic.RCS1080.severity = error # RCS1090: Add call to 'ConfigureAwait' (or vice versa). dotnet_diagnostic.RCS1090.severity = none dotnet_diagnostic.RCS0031.severity = error dotnet_diagnostic.RCS1021.severity = suggestion dotnet_diagnostic.RCS1048.severity = error dotnet_diagnostic.RCS1068.severity = suggestion dotnet_diagnostic.RCS1105.severity = warning dotnet_diagnostic.RCS1107.severity = error dotnet_diagnostic.RCS1112.severity = warning dotnet_diagnostic.RCS1113.severity = error dotnet_diagnostic.RCS1143.severity = warning dotnet_diagnostic.RCS1154.severity = error dotnet_diagnostic.RCS1172.severity = error dotnet_diagnostic.RCS1174.severity = error dotnet_diagnostic.RCS1197.severity = warning dotnet_diagnostic.RCS1202.severity = warning dotnet_diagnostic.RCS1234.severity = error dotnet_diagnostic.RCS1246.severity = warning dotnet_diagnostic.RCS9004.severity = none