|
| 1 | +root = true |
| 2 | + |
| 3 | +# Must-have extension for: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.EditorConfig |
| 4 | + |
| 5 | +[*] |
| 6 | +charset = utf-8 |
| 7 | +end_of_line = lf |
| 8 | +indent_style = space |
| 9 | +indent_size = 4 |
| 10 | + |
| 11 | +[*.{html,cshtml}] |
| 12 | +indent_size = 2 |
| 13 | + |
| 14 | +# Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_Razor_CSharp_RazorCodeStylePageImplSchema.html |
| 15 | +linebreaks_around_razor_statements = true |
| 16 | +html_blank_lines_around_razor_functions = 2 |
| 17 | +blank_lines_around_razor_helpers = 1 |
| 18 | +blank_lines_around_razor_sections = 1 |
| 19 | + |
| 20 | +spaces_around_eq_in_attribute = false |
| 21 | +space_after_last_attribute = false |
| 22 | +space_before_self_closing = false |
| 23 | +attribute_style = do_not_touch |
| 24 | +attribute_indent = align_by_first_attribute |
| 25 | + |
| 26 | +sort_class_selectors = false |
| 27 | +linebreak_before_all_elements = false |
| 28 | +extra_spaces = leave_all |
| 29 | +quote_style = doublequoted |
| 30 | +delete_quotes_from_solid_values = false |
| 31 | +normalize_tag_names = true |
| 32 | + |
| 33 | +[*.{scss,css}] |
| 34 | +#Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_CSS_CodeLayoutPageSchema.html |
| 35 | +# (note these settings don't matter much - prettier takes over when committing files anyway) |
| 36 | + |
| 37 | +declarations_style = separate_lines |
| 38 | +brace_style = end_of_line |
| 39 | +keep_user_linebreaks = true |
| 40 | +keep_blank_lines_between_declarations = 1 |
| 41 | +space_around_selector_operator = true |
| 42 | + |
| 43 | +[*.{js,ts}] |
| 44 | +#Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_JAVA_SCRIPT_BracesPageSchema.html |
| 45 | +# (note these settings don't matter much - prettier takes over when committing files anyway) |
| 46 | + |
| 47 | +empty_block_style = together |
| 48 | +function_braces = end_of_line |
| 49 | +function_in_invocation_braces = end_of_line |
| 50 | +control_statements_braces = end_of_line |
| 51 | +indent_pars = outside_and_inside |
| 52 | +force_control_statements_braces = do_not_change |
| 53 | +indent_switch_labels = true |
| 54 | +space_before_colon_in_type_annotation = false |
| 55 | +space_around_pipe_or_amper_in_type_usage = false |
| 56 | + |
| 57 | +[*.xml] |
| 58 | +indent_size = 2 |
| 59 | + |
| 60 | +[*.json] |
| 61 | +indent_size = 4 |
| 62 | + |
| 63 | +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] |
| 64 | +indent_size = 2 |
| 65 | + |
| 66 | +[*.{cs,cshtml}] |
| 67 | +charset = utf-8-bom |
| 68 | + |
| 69 | +[*.{cs,ts,js,scss,css}] |
| 70 | +trim_trailing_whitespace = true |
| 71 | +insert_final_newline = true |
| 72 | + |
| 73 | +# Line length in .prettierrc |
| 74 | +max_line_length = 120 |
| 75 | + |
| 76 | +[*] |
| 77 | +## Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#language-conventions |
| 78 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#this_and_me |
| 79 | +dotnet_style_qualification_for_field = true:error |
| 80 | +dotnet_style_qualification_for_property = true:error |
| 81 | +dotnet_style_qualification_for_method = true:suggestion |
| 82 | +dotnet_style_qualification_for_event = true:error |
| 83 | + |
| 84 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#language_keywords |
| 85 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 86 | +dotnet_style_predefined_type_for_member_access = false:suggestion |
| 87 | + |
| 88 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#normalize_modifiers |
| 89 | +dotnet_style_require_accessibility_modifiers = always:error |
| 90 | +dotnet_style_readonly_field = true:error |
| 91 | + |
| 92 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#parentheses |
| 93 | +dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent |
| 94 | +dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent |
| 95 | +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent |
| 96 | +dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent |
| 97 | + |
| 98 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#expression_level |
| 99 | +dotnet_style_object_initializer=true:suggestion |
| 100 | +dotnet_style_collection_initializer=true:suggestion |
| 101 | +dotnet_style_explicit_tuple_names=true:warning |
| 102 | +dotnet_style_prefer_inferred_tuple_names = false:none |
| 103 | +dotnet_style_prefer_inferred_anonymous_type_member_names=true:suggestion |
| 104 | +dotnet_style_prefer_auto_properties=true:suggestion |
| 105 | +dotnet_style_prefer_is_null_check_over_reference_equality_method=true:warning |
| 106 | +dotnet_style_prefer_conditional_expression_over_assignment=true:suggestion |
| 107 | +dotnet_style_prefer_conditional_expression_over_return=true:suggestion |
| 108 | + |
| 109 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#null_checking |
| 110 | +dotnet_style_coalesce_expression = true:suggestion |
| 111 | +dotnet_style_null_propagation = true:suggestion |
| 112 | + |
| 113 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#implicit-and-explicit-types |
| 114 | +csharp_style_var_for_built_in_types = false:suggestion |
| 115 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 116 | +csharp_style_var_elsewhere = false:suggestion |
| 117 | + |
| 118 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#expression_bodied_members |
| 119 | +csharp_style_expression_bodied_methods = when_on_single_line:suggestion |
| 120 | +csharp_style_expression_bodied_constructors = false:warning |
| 121 | +csharp_style_expression_bodied_operators = when_on_single_line:suggestion |
| 122 | +csharp_style_expression_bodied_properties = when_on_single_line:suggestion |
| 123 | +csharp_style_expression_bodied_indexers = when_on_single_line:suggestion |
| 124 | +csharp_style_expression_bodied_accessors = when_on_single_line:suggestion |
| 125 | + |
| 126 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#pattern_matching |
| 127 | +csharp_style_pattern_matching_over_is_with_cast_check=true:warning |
| 128 | +csharp_style_pattern_matching_over_as_with_null_check=true:suggestion |
| 129 | + |
| 130 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#inlined_variable_declarations |
| 131 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 132 | + |
| 133 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#expression_level_csharp |
| 134 | +csharp_prefer_simple_default_expression=true:warning |
| 135 | +csharp_style_deconstructed_variable_declaration=true:suggestion |
| 136 | +csharp_style_pattern_local_over_anonymous_function=true:suggestion |
| 137 | + |
| 138 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#null_checking_csharp |
| 139 | +csharp_style_throw_expression=true:suggestion |
| 140 | +csharp_style_conditional_delegate_call=true:suggestion |
| 141 | + |
| 142 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#code_block |
| 143 | +csharp_prefer_braces=false:suggestion |
| 144 | + |
| 145 | +## Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#formatting-conventions |
| 146 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#usings |
| 147 | +dotnet_sort_system_directives_first = false:warning |
| 148 | +dotnet_separate_import_directive_groups = true:suggestion |
| 149 | + |
| 150 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#newline |
| 151 | +csharp_new_line_before_open_brace = all:warning |
| 152 | +csharp_new_line_before_else = false:warning |
| 153 | +csharp_new_line_before_catch = false:warning |
| 154 | +csharp_new_line_before_finally = true:warning |
| 155 | +csharp_new_line_before_members_in_object_initializers = true:warning |
| 156 | +csharp_new_line_before_members_in_anonymous_types = true:warning |
| 157 | +csharp_new_line_between_query_expression_clauses = true:warning |
| 158 | + |
| 159 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#indent |
| 160 | +csharp_indent_case_contents = true:warning |
| 161 | +csharp_indent_switch_labels = true:warning |
| 162 | +csharp_indent_labels = flush_left:warning |
| 163 | + |
| 164 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#spacing |
| 165 | +csharp_space_after_cast = true:warning |
| 166 | +csharp_space_after_keywords_in_control_flow_statements = true:warning |
| 167 | +csharp_space_between_method_declaration_parameter_list_parentheses = false:warning |
| 168 | +csharp_space_between_method_call_parameter_list_parentheses = false:warning |
| 169 | +csharp_space_between_parentheses = expressions:silent |
| 170 | +csharp_space_before_colon_in_inheritance_clause = true:warning |
| 171 | +csharp_space_after_colon_in_inheritance_clause = true:warning |
| 172 | +csharp_space_around_binary_operators = before_and_after:suggestion |
| 173 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning |
| 174 | +csharp_space_between_method_call_name_and_opening_parenthesis = false:warning |
| 175 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning |
| 176 | + |
| 177 | +# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#wrapping |
| 178 | +csharp_preserve_single_line_statements = false:suggestion |
| 179 | +csharp_preserve_single_line_blocks = true:silent |
| 180 | + |
| 181 | +## Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2017 |
| 182 | + |
| 183 | + |
| 184 | +# By default, name items with PascalCase |
| 185 | +dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion |
| 186 | +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members |
| 187 | +dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style |
| 188 | + |
| 189 | +dotnet_naming_symbols.all_members.applicable_kinds = namespace, class, struct, interface, enum, property, method, event, delegate, type_parameter, local_function |
| 190 | + |
| 191 | +dotnet_naming_style.pascal_case_style.capitalization = pascal_case |
| 192 | + |
| 193 | +# Public members must be capitalized (public_members_must_be_capitalized) |
| 194 | +dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols |
| 195 | +dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate |
| 196 | +dotnet_naming_symbols.public_symbols.applicable_accessibilities = public |
| 197 | +dotnet_naming_symbols.public_symbols.required_modifiers = readonly |
| 198 | + |
| 199 | +dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style |
| 200 | +dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper |
| 201 | + |
| 202 | +dotnet_naming_rule.public_members_must_be_capitalized.severity = suggestion |
| 203 | + |
| 204 | +# Non-private static fields are PascalCase |
| 205 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion |
| 206 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields |
| 207 | +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style |
| 208 | + |
| 209 | +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field |
| 210 | +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected |
| 211 | +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static |
| 212 | + |
| 213 | +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case |
| 214 | + |
| 215 | +# Constants are PascalCase |
| 216 | +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion |
| 217 | +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants |
| 218 | +dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style |
| 219 | + |
| 220 | +dotnet_naming_symbols.constants.applicable_kinds = field, local |
| 221 | +dotnet_naming_symbols.constants.required_modifiers = const |
| 222 | + |
| 223 | +dotnet_naming_style.constant_style.capitalization = pascal_case |
| 224 | + |
| 225 | + |
| 226 | +# Instance fields are camelCase and start with _ |
| 227 | +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion |
| 228 | +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields |
| 229 | +dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style |
| 230 | + |
| 231 | +dotnet_naming_symbols.instance_fields.applicable_kinds = field |
| 232 | + |
| 233 | +dotnet_naming_style.instance_field_style.capitalization = camel_case |
| 234 | +dotnet_naming_style.instance_field_style.required_prefix = _ |
| 235 | + |
| 236 | + |
| 237 | +# Local functions are PascalCase |
| 238 | +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion |
| 239 | +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions |
| 240 | +dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style |
| 241 | + |
| 242 | +dotnet_naming_symbols.local_functions.applicable_kinds = local_function |
| 243 | + |
| 244 | +dotnet_naming_style.local_function_style.capitalization = pascal_case |
| 245 | + |
| 246 | +# Locals are camelCase |
| 247 | +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion |
| 248 | +dotnet_naming_rule.locals_should_be_camel_case.symbols = local |
| 249 | +dotnet_naming_rule.locals_should_be_camel_case.style = locals_style |
| 250 | + |
| 251 | +dotnet_naming_symbols.locals_style.applicable_kinds = local |
| 252 | + |
| 253 | +dotnet_naming_style.locals_style.capitalization = camel_case |
| 254 | + |
| 255 | + |
| 256 | +# Static fields are PascalCased and are not prefixed |
| 257 | +dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion |
| 258 | +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields |
| 259 | +dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style |
| 260 | + |
| 261 | +dotnet_naming_symbols.static_fields.applicable_kinds = field |
| 262 | +dotnet_naming_symbols.static_fields.required_modifiers = static |
| 263 | + |
| 264 | +dotnet_naming_style.static_field_style.capitalization = pascal_case |
| 265 | + |
| 266 | +# Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_Index.html |
| 267 | +add_imports_to_deepest_scope = true |
| 268 | + |
| 269 | +default_private_modifier = explicit |
| 270 | + |
| 271 | +arguments_literal = named |
| 272 | +arguments_string_literal = named |
| 273 | +arguments_named = named |
| 274 | +arguments_anonymous_function = named |
| 275 | + |
| 276 | +braces_for_ifelse = required_for_multiline_statement |
| 277 | +braces_for_for = required |
| 278 | +braces_for_foreach = required |
| 279 | +braces_for_while = required_for_multiline |
| 280 | +braces_for_dowhile = required |
| 281 | +braces_for_dowhile = required |
| 282 | +braces_for_using = required_for_multiline |
| 283 | +braces_for_lock = required |
| 284 | +braces_for_fixed = required |
| 285 | + |
| 286 | +braces_redundant = true |
| 287 | + |
| 288 | +local_function_body = expression_body |
| 289 | +constructor_or_destructor_body = block_body |
| 290 | + |
| 291 | +force_attribute_style = separate |
| 292 | + |
| 293 | +csharp_keep_user_linebreaks = true |
| 294 | + |
| 295 | +keep_existing_attribute_arrangement = false |
| 296 | +place_attribute_on_same_line = if_owner_is_single_line |
| 297 | + |
| 298 | +csharp_wrap_parameters_style = chop_if_long |
| 299 | +keep_existing_declaration_parens_arrangement = false |
| 300 | + |
| 301 | +wrap_before_declaration_lpar = false |
| 302 | +wrap_after_declaration_lpar = true |
| 303 | +wrap_before_declaration_rpar = true |
| 304 | + |
| 305 | +place_constructor_initializer_on_same_line = true |
| 306 | + |
| 307 | +csharp_wrap_arguments_style = chop_if_long |
| 308 | +csharp_wrap_after_dot_in_method_calls = true |
| 309 | +csharp_wrap_chained_method_calls = chop_if_long |
| 310 | +csharp_wrap_before_binary_opsign = false |
| 311 | + |
| 312 | +csharp_wrap_linq_expressions = chop_always |
| 313 | +csharp_wrap_before_linq_expression = true |
| 314 | +csharp_place_linq_into_on_new_line = false |
| 315 | + |
| 316 | +csharp_extra_spaces = remove_all |
| 317 | +space_before_colon_in_inheritance_clause = true |
| 318 | +space_after_colon_in_inheritance_clause = true |
| 319 | + |
| 320 | +space_before_type_parameter_constraint_colon= true |
| 321 | +space_after_type_parameter_constraint_colon= true |
| 322 | + |
| 323 | +[*.cs] |
| 324 | + |
| 325 | +# CS0660: Type defines operator == or operator != but does not override Object.Equals(object o) |
| 326 | +dotnet_diagnostic.CS0660.severity = none |
0 commit comments