|
| 1 | +root = true |
| 2 | +# editorconfig.org |
| 3 | + |
| 4 | +# top-most EditorConfig file |
| 5 | + |
| 6 | +# Default settings: |
| 7 | +# A newline ending every file |
| 8 | +# Use 4 spaces as indentation |
| 9 | +[*] |
| 10 | +insert_final_newline = false |
| 11 | +indent_style = space |
| 12 | +indent_size = 4 |
| 13 | + |
| 14 | +# ReSharper properties |
| 15 | +resharper_place_simple_initializer_on_single_line = true |
| 16 | +resharper_wrap_before_arrow_with_expressions = false |
| 17 | +resharper_xml_wrap_lines = false |
| 18 | +dotnet_style_operator_placement_when_wrapping = beginning_of_line |
| 19 | +tab_width = 4 |
| 20 | +end_of_line = crlf |
| 21 | +dotnet_style_coalesce_expression = true:suggestion |
| 22 | +dotnet_style_null_propagation = true:suggestion |
| 23 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
| 24 | +dotnet_style_prefer_auto_properties = true:silent |
| 25 | +dotnet_style_object_initializer = true:suggestion |
| 26 | + |
| 27 | +# C# files |
| 28 | +[*.cs] |
| 29 | +# New line preferences |
| 30 | +csharp_new_line_before_open_brace = none |
| 31 | +csharp_new_line_before_else = true |
| 32 | +csharp_new_line_before_catch = true |
| 33 | +csharp_new_line_before_finally = true |
| 34 | +csharp_new_line_before_members_in_object_initializers = false |
| 35 | +csharp_new_line_before_members_in_anonymous_types = true |
| 36 | +csharp_new_line_between_query_expression_clauses = true |
| 37 | +# trim_trailing_whitespace = true |
| 38 | + |
| 39 | +# Indentation preferences |
| 40 | +csharp_indent_block_contents = true |
| 41 | +csharp_indent_braces = false |
| 42 | +csharp_indent_case_contents = true |
| 43 | +csharp_indent_switch_labels = true |
| 44 | +csharp_indent_labels = one_less_than_current |
| 45 | + |
| 46 | +# avoid this. unless absolutely necessary |
| 47 | +dotnet_style_qualification_for_field = false:suggestion |
| 48 | +dotnet_style_qualification_for_property = false:suggestion |
| 49 | +dotnet_style_qualification_for_method = false:suggestion |
| 50 | +dotnet_style_qualification_for_event = false:suggestion |
| 51 | + |
| 52 | +# prefer var |
| 53 | +csharp_style_var_for_built_in_types = true |
| 54 | +csharp_style_var_when_type_is_apparent = true |
| 55 | +csharp_style_var_elsewhere = true:suggestion |
| 56 | + |
| 57 | +# use language keywords instead of BCL types |
| 58 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 59 | +dotnet_style_predefined_type_for_member_access = true:suggestion |
| 60 | + |
| 61 | +# name all constant fields using PascalCase |
| 62 | +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion |
| 63 | +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields |
| 64 | +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style |
| 65 | + |
| 66 | +dotnet_naming_symbols.constant_fields.applicable_kinds = field |
| 67 | +dotnet_naming_symbols.constant_fields.required_modifiers = const |
| 68 | + |
| 69 | +dotnet_naming_style.pascal_case_style.capitalization = pascal_case |
| 70 | + |
| 71 | +# internal and private fields should be _camelCase |
| 72 | +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion |
| 73 | +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields |
| 74 | +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style |
| 75 | + |
| 76 | +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field |
| 77 | +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal |
| 78 | + |
| 79 | +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ |
| 80 | +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case |
| 81 | + |
| 82 | +# use accessibility modifiers |
| 83 | +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion |
| 84 | + |
| 85 | +# Code style defaults |
| 86 | +dotnet_sort_system_directives_first = true |
| 87 | +csharp_preserve_single_line_blocks = true |
| 88 | +csharp_preserve_single_line_statements = false |
| 89 | + |
| 90 | +# Expression-level preferences |
| 91 | +dotnet_style_object_initializer = true:suggestion |
| 92 | +dotnet_style_collection_initializer = true:suggestion |
| 93 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 94 | +dotnet_style_coalesce_expression = true:suggestion |
| 95 | +dotnet_style_null_propagation = true:suggestion |
| 96 | + |
| 97 | +# Expression-bodied members |
| 98 | +csharp_style_expression_bodied_methods = false:none |
| 99 | +csharp_style_expression_bodied_constructors = false:none |
| 100 | +csharp_style_expression_bodied_operators = false:none |
| 101 | +csharp_style_expression_bodied_properties = true:none |
| 102 | +csharp_style_expression_bodied_indexers = true:none |
| 103 | +csharp_style_expression_bodied_accessors = true:none |
| 104 | + |
| 105 | +# Pattern matching |
| 106 | +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion |
| 107 | +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion |
| 108 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 109 | + |
| 110 | +# Null checking preferences |
| 111 | +csharp_style_throw_expression = true:suggestion |
| 112 | +csharp_style_conditional_delegate_call = true:suggestion |
| 113 | + |
| 114 | +# Space preferences |
| 115 | +csharp_space_after_cast = false |
| 116 | +csharp_space_after_colon_in_inheritance_clause = true |
| 117 | +csharp_space_after_comma = true |
| 118 | +csharp_space_after_dot = false |
| 119 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 120 | +csharp_space_after_semicolon_in_for_statement = true |
| 121 | +csharp_space_around_binary_operators = before_and_after |
| 122 | +csharp_space_before_colon_in_inheritance_clause = true |
| 123 | +csharp_space_before_comma = false |
| 124 | +csharp_space_before_dot = false |
| 125 | +csharp_space_before_open_square_brackets = false |
| 126 | +csharp_space_before_semicolon_in_for_statement = false |
| 127 | +csharp_space_between_empty_square_brackets = false |
| 128 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 129 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 130 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 131 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 132 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false |
| 133 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 134 | +csharp_space_between_parentheses = false |
| 135 | +csharp_space_between_square_brackets = false |
| 136 | +space_within_single_line_array_initializer_braces = true |
| 137 | +csharp_using_directive_placement = outside_namespace:silent |
| 138 | +csharp_prefer_simple_using_statement = true:suggestion |
| 139 | +csharp_prefer_braces = when_multiline:silent |
| 140 | +csharp_style_namespace_declarations = file_scoped:silent |
| 141 | +csharp_style_prefer_method_group_conversion = true:silent |
| 142 | +csharp_style_prefer_top_level_statements = true:silent |
| 143 | +csharp_style_expression_bodied_lambdas = true:silent |
| 144 | +csharp_style_expression_bodied_local_functions = false:silent |
| 145 | + |
| 146 | +# Xaml files |
| 147 | +[*.{xaml,axaml}] |
| 148 | +indent_size = 2 |
| 149 | + |
| 150 | +# Xml project files |
| 151 | +[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] |
| 152 | +indent_size = 2 |
| 153 | + |
| 154 | +# Xml build files |
| 155 | +[*.builds] |
| 156 | +indent_size = 2 |
| 157 | + |
| 158 | +# Xml files |
| 159 | +[*.{xml,stylecop,resx,ruleset}] |
| 160 | +indent_size = 2 |
| 161 | + |
| 162 | +# Xml config files |
| 163 | +[*.{props,targets,config,nuspec}] |
| 164 | +indent_size = 2 |
| 165 | + |
| 166 | +[*.json] |
| 167 | +indent_size = 2 |
| 168 | + |
| 169 | +# Shell scripts |
| 170 | +[*.sh] |
| 171 | +end_of_line = lf |
| 172 | + |
| 173 | +[*.{cmd, bat}] |
| 174 | +end_of_line = crlf |
0 commit comments