|
| 1 | +# http://EditorConfig.org |
| 2 | + |
| 3 | +################# |
| 4 | +# Common Settings |
| 5 | +################# |
| 6 | + |
| 7 | +# This file is the top-most EditorConfig file |
| 8 | +root = true |
| 9 | + |
| 10 | +# All Files |
| 11 | +[*] |
| 12 | +charset = utf-8 |
| 13 | +end_of_line = crlf |
| 14 | +indent_style = space |
| 15 | +indent_size = 4 |
| 16 | +insert_final_newline = false |
| 17 | +trim_trailing_whitespace = true |
| 18 | + |
| 19 | +######################### |
| 20 | +# File Extension Settings |
| 21 | +######################### |
| 22 | + |
| 23 | +# Visual Studio Solution Files |
| 24 | +[*.sln] |
| 25 | +indent_style = tab |
| 26 | + |
| 27 | +# Visual Studio XML Project Files |
| 28 | +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] |
| 29 | +indent_size = 2 |
| 30 | + |
| 31 | +# XML Configuration Files |
| 32 | +[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}] |
| 33 | +indent_size = 2 |
| 34 | + |
| 35 | +# JSON Files |
| 36 | +[*.{json,json5}] |
| 37 | +indent_size = 2 |
| 38 | + |
| 39 | +# YAML Files |
| 40 | +[*.{yml,yaml}] |
| 41 | +indent_size = 2 |
| 42 | + |
| 43 | +# Markdown Files |
| 44 | +[*.md] |
| 45 | +trim_trailing_whitespace = false |
| 46 | + |
| 47 | +# Web Files |
| 48 | +[*.{htm,html,js,ts,tsx,css,sass,scss,less,svg,vue}] |
| 49 | +indent_size = 2 |
| 50 | +insert_final_newline = true |
| 51 | + |
| 52 | +# Batch Files |
| 53 | +[*.{cmd,bat}] |
| 54 | + |
| 55 | +# Bash Files |
| 56 | +[*.sh] |
| 57 | +end_of_line = lf |
| 58 | + |
| 59 | +########################### |
| 60 | +# .NET Language Conventions |
| 61 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions |
| 62 | +########################### |
| 63 | + |
| 64 | +# .NET Code Style Settings |
| 65 | +[*.{cs,csx,cake,vb}] |
| 66 | +# "this." and "Me." qualifiers |
| 67 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#this_and_me |
| 68 | +dotnet_style_qualification_for_field = true:warning |
| 69 | +dotnet_style_qualification_for_property = true:warning |
| 70 | +dotnet_style_qualification_for_method = true:warning |
| 71 | +dotnet_style_qualification_for_event = true:warning |
| 72 | +# Language keywords instead of framework type names for type references |
| 73 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language_keywords |
| 74 | +dotnet_style_predefined_type_for_locals_parameters_members = true:warning |
| 75 | +dotnet_style_predefined_type_for_member_access = true:warning |
| 76 | +# Modifier preferences |
| 77 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#normalize_modifiers |
| 78 | +dotnet_style_require_accessibility_modifiers = always:warning |
| 79 | +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async |
| 80 | +visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async |
| 81 | +dotnet_style_readonly_field = true:warning |
| 82 | +# Parentheses preferences |
| 83 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#parentheses |
| 84 | +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning |
| 85 | +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning |
| 86 | +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning |
| 87 | +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion |
| 88 | +# Expression-level preferences |
| 89 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level |
| 90 | +dotnet_style_object_initializer = true:warning |
| 91 | +dotnet_style_collection_initializer = true:warning |
| 92 | +dotnet_style_explicit_tuple_names = true:warning |
| 93 | +dotnet_style_prefer_inferred_tuple_names = true:warning |
| 94 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning |
| 95 | +dotnet_style_prefer_auto_properties = true:warning |
| 96 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning |
| 97 | +dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion |
| 98 | +dotnet_style_prefer_conditional_expression_over_return = false:suggestion |
| 99 | +# Null-checking preferences |
| 100 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking |
| 101 | +dotnet_style_coalesce_expression = true:warning |
| 102 | +dotnet_style_null_propagation = true:warning |
| 103 | + |
| 104 | +# C# Code Style Settings |
| 105 | +[*.{cs,csx,cake}] |
| 106 | +# Implicit and explicit types |
| 107 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#implicit-and-explicit-types |
| 108 | +csharp_style_var_for_built_in_types = true:warning |
| 109 | +csharp_style_var_when_type_is_apparent = true:warning |
| 110 | +csharp_style_var_elsewhere = true:warning |
| 111 | +# Expression-bodied members |
| 112 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_bodied_members |
| 113 | +csharp_style_expression_bodied_methods = true:warning |
| 114 | +csharp_style_expression_bodied_constructors = true:warning |
| 115 | +csharp_style_expression_bodied_operators = true:warning |
| 116 | +csharp_style_expression_bodied_properties = true:warning |
| 117 | +csharp_style_expression_bodied_indexers = true:warning |
| 118 | +csharp_style_expression_bodied_accessors = true:warning |
| 119 | +# Pattern matching |
| 120 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#pattern_matching |
| 121 | +csharp_style_pattern_matching_over_is_with_cast_check = true:warning |
| 122 | +csharp_style_pattern_matching_over_as_with_null_check = true:warning |
| 123 | +# Inlined variable declarations |
| 124 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#inlined_variable_declarations |
| 125 | +csharp_style_inlined_variable_declaration = true:warning |
| 126 | +# Expression-level preferences |
| 127 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#expression_level_csharp |
| 128 | +csharp_prefer_simple_default_expression = true:warning |
| 129 | +csharp_style_deconstructed_variable_declaration = true:warning |
| 130 | +csharp_style_pattern_local_over_anonymous_function = true:warning |
| 131 | +# "Null" checking preferences |
| 132 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#null_checking_csharp |
| 133 | +csharp_style_throw_expression = true:warning |
| 134 | +csharp_style_conditional_delegate_call = true:warning |
| 135 | +# Code block preferences |
| 136 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#code_block |
| 137 | +csharp_prefer_braces = true:warning |
| 138 | + |
| 139 | +############################# |
| 140 | +# .NET Formatting Conventions |
| 141 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions |
| 142 | +############################# |
| 143 | + |
| 144 | +# Organize usings |
| 145 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#usings |
| 146 | +dotnet_sort_system_directives_first = true |
| 147 | +# C# formatting settings |
| 148 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#c-formatting-settings |
| 149 | +csharp_new_line_before_open_brace = all |
| 150 | +csharp_new_line_before_else = true |
| 151 | +csharp_new_line_before_catch = true |
| 152 | +csharp_new_line_before_finally = true |
| 153 | +csharp_new_line_before_members_in_object_initializers = true |
| 154 | +csharp_new_line_before_members_in_anonymous_types = true |
| 155 | +csharp_new_line_between_query_expression_clauses = true |
| 156 | +# Indentation options |
| 157 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#indent |
| 158 | +csharp_indent_case_contents = true |
| 159 | +csharp_indent_switch_labels = true |
| 160 | +csharp_indent_labels = no_change |
| 161 | +# Spacing options |
| 162 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#spacing |
| 163 | +csharp_space_after_cast = false |
| 164 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 165 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 166 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 167 | +csharp_space_between_parentheses = expressions |
| 168 | +csharp_space_before_colon_in_inheritance_clause = true |
| 169 | +csharp_space_after_colon_in_inheritance_clause = true |
| 170 | +csharp_space_around_binary_operators = before_and_after |
| 171 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 172 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 173 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 174 | +# Wrapping options |
| 175 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#wrapping |
| 176 | +csharp_preserve_single_line_statements = false |
| 177 | +csharp_preserve_single_line_blocks = true |
| 178 | +# More Indentation options (Undocumented) |
| 179 | +csharp_indent_block_contents = true |
| 180 | +csharp_indent_braces = false |
| 181 | +# Spacing Options (Undocumented) |
| 182 | +csharp_space_after_comma = true |
| 183 | +csharp_space_after_dot = false |
| 184 | +csharp_space_after_semicolon_in_for_statement = true |
| 185 | +csharp_space_around_declaration_statements = do_not_ignore |
| 186 | +csharp_space_before_comma = false |
| 187 | +csharp_space_before_dot = false |
| 188 | +csharp_space_before_semicolon_in_for_statement = false |
| 189 | +csharp_space_before_open_square_brackets = false |
| 190 | +csharp_space_between_empty_square_brackets = false |
| 191 | +csharp_space_between_method_declaration_name_and_open_parenthesis = false |
| 192 | +csharp_space_between_square_brackets = false |
| 193 | + |
| 194 | +######################### |
| 195 | +# .NET Naming conventions |
| 196 | +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions |
| 197 | +######################### |
| 198 | + |
| 199 | +[*.{cs,csx,cake,vb}] |
| 200 | +# Naming Symbols |
| 201 | +# constant_fields - Define constant fields |
| 202 | +dotnet_naming_symbols.constant_fields.applicable_kinds = field |
| 203 | +dotnet_naming_symbols.constant_fields.required_modifiers = const |
| 204 | +# non_private_readonly_fields - Define public, internal and protected readonly fields |
| 205 | +dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, internal, protected |
| 206 | +dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field |
| 207 | +dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly |
| 208 | +# static_readonly_fields - Define static and readonly fields |
| 209 | +dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field |
| 210 | +dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly |
| 211 | +# private_readonly_fields - Define private readonly fields |
| 212 | +dotnet_naming_symbols.private_readonly_fields.applicable_accessibilities = private |
| 213 | +dotnet_naming_symbols.private_readonly_fields.applicable_kinds = field |
| 214 | +dotnet_naming_symbols.private_readonly_fields.required_modifiers = readonly |
| 215 | +# public_internal_fields - Define public and internal fields |
| 216 | +dotnet_naming_symbols.public_internal_fields.applicable_accessibilities = public, internal |
| 217 | +dotnet_naming_symbols.public_internal_fields.applicable_kinds = field |
| 218 | +# private_protected_fields - Define private and protected fields |
| 219 | +dotnet_naming_symbols.private_protected_fields.applicable_accessibilities = private, protected |
| 220 | +dotnet_naming_symbols.private_protected_fields.applicable_kinds = field |
| 221 | +# public_symbols - Define any public symbol |
| 222 | +dotnet_naming_symbols.public_symbols.applicable_accessibilities = public, internal, protected, protected_internal |
| 223 | +dotnet_naming_symbols.public_symbols.applicable_kinds = method, property, event, delegate |
| 224 | +# parameters - Defines any parameter |
| 225 | +dotnet_naming_symbols.parameters.applicable_kinds = parameter |
| 226 | +# non_interface_types - Defines class, struct, enum and delegate types |
| 227 | +dotnet_naming_symbols.non_interface_types.applicable_kinds = class, struct, enum, delegate |
| 228 | +# interface_types - Defines interfaces |
| 229 | +dotnet_naming_symbols.interface_types.applicable_kinds = interface |
| 230 | + |
| 231 | +# Naming Styles |
| 232 | +# camel_case - Define the camelCase style |
| 233 | +dotnet_naming_style.camel_case.capitalization = camel_case |
| 234 | +# pascal_case - Define the Pascal_case style |
| 235 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 236 | +# first_upper - The first character must start with an upper-case character |
| 237 | +dotnet_naming_style.first_upper.capitalization = first_word_upper |
| 238 | +# prefix_interface_interface_with_i - Interfaces must be PascalCase and the first character of an interface must be an 'I' |
| 239 | +dotnet_naming_style.prefix_interface_interface_with_i.capitalization = pascal_case |
| 240 | +dotnet_naming_style.prefix_interface_interface_with_i.required_prefix = I |
| 241 | + |
| 242 | +# Naming Rules |
| 243 | +# Constant fields must be PascalCase |
| 244 | +dotnet_naming_rule.constant_fields_must_be_pascal_case.severity = warning |
| 245 | +dotnet_naming_rule.constant_fields_must_be_pascal_case.symbols = constant_fields |
| 246 | +dotnet_naming_rule.constant_fields_must_be_pascal_case.style = pascal_case |
| 247 | +# Public, internal and protected readonly fields must be PascalCase |
| 248 | +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.severity = warning |
| 249 | +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.symbols = non_private_readonly_fields |
| 250 | +dotnet_naming_rule.non_private_readonly_fields_must_be_pascal_case.style = pascal_case |
| 251 | +# Static readonly fields must be PascalCase |
| 252 | +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.severity = warning |
| 253 | +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.symbols = static_readonly_fields |
| 254 | +dotnet_naming_rule.static_readonly_fields_must_be_pascal_case.style = pascal_case |
| 255 | +# Private readonly fields must be camelCase |
| 256 | +dotnet_naming_rule.private_readonly_fields_must_be_camel_case.severity = warning |
| 257 | +dotnet_naming_rule.private_readonly_fields_must_be_camel_case.symbols = private_readonly_fields |
| 258 | +dotnet_naming_rule.private_readonly_fields_must_be_camel_case.style = camel_case |
| 259 | +# Public and internal fields must be PascalCase |
| 260 | +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.severity = warning |
| 261 | +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.symbols = public_internal_fields |
| 262 | +dotnet_naming_rule.public_internal_fields_must_be_pascal_case.style = pascal_case |
| 263 | +# Private and protected fields must be camelCase |
| 264 | +dotnet_naming_rule.private_protected_fields_must_be_camel_case.severity = warning |
| 265 | +dotnet_naming_rule.private_protected_fields_must_be_camel_case.symbols = private_protected_fields |
| 266 | +dotnet_naming_rule.private_protected_fields_must_be_camel_case.style = camel_case |
| 267 | +# Public members must be capitalized |
| 268 | +dotnet_naming_rule.public_members_must_be_capitalized.severity = warning |
| 269 | +dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols |
| 270 | +dotnet_naming_rule.public_members_must_be_capitalized.style = first_upper |
| 271 | +# Parameters must be camelCase |
| 272 | +dotnet_naming_rule.parameters_must_be_camel_case.severity = warning |
| 273 | +dotnet_naming_rule.parameters_must_be_camel_case.symbols = parameters |
| 274 | +dotnet_naming_rule.parameters_must_be_camel_case.style = camel_case |
| 275 | +# Class, struct, enum and delegates must be PascalCase |
| 276 | +dotnet_naming_rule.non_interface_types_must_be_pascal_case.severity = warning |
| 277 | +dotnet_naming_rule.non_interface_types_must_be_pascal_case.symbols = non_interface_types |
| 278 | +dotnet_naming_rule.non_interface_types_must_be_pascal_case.style = pascal_case |
| 279 | +# Interfaces must be PascalCase and start with an 'I' |
| 280 | +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = warning |
| 281 | +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.symbols = interface_types |
| 282 | +dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = prefix_interface_interface_with_i |
0 commit comments