|
| 1 | +root = true |
| 2 | + |
| 3 | +[*] |
| 4 | +indent_style = space |
| 5 | +indent_size = 4 |
| 6 | +end_of_line = lf |
| 7 | +charset = utf-8 |
| 8 | +trim_trailing_whitespace = true |
| 9 | +insert_final_newline = true |
| 10 | + |
| 11 | +[*.{csproj,props,targets,xml,slnx}] |
| 12 | +indent_size = 2 |
| 13 | + |
| 14 | +[*.{json,yml,yaml}] |
| 15 | +indent_size = 2 |
| 16 | + |
| 17 | +[*.md] |
| 18 | +trim_trailing_whitespace = false |
| 19 | + |
| 20 | +# C# style rules |
| 21 | +[*.cs] |
| 22 | +# Namespace and using preferences |
| 23 | +csharp_style_namespace_declarations = file_scoped:suggestion |
| 24 | +csharp_using_directive_placement = outside_namespace:suggestion |
| 25 | +dotnet_sort_system_directives_first = true |
| 26 | + |
| 27 | +# var preferences |
| 28 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 29 | +csharp_style_var_for_built_in_types = false:suggestion |
| 30 | +csharp_style_var_elsewhere = false:suggestion |
| 31 | + |
| 32 | +# Expression-level preferences |
| 33 | +csharp_style_prefer_switch_expression = true:suggestion |
| 34 | +csharp_style_prefer_pattern_matching = true:suggestion |
| 35 | +csharp_style_prefer_not_pattern = true:suggestion |
| 36 | +csharp_prefer_simple_using_statement = true:suggestion |
| 37 | +csharp_style_prefer_null_check_over_type_check = true:suggestion |
| 38 | + |
| 39 | +# Modifier preferences |
| 40 | +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion |
| 41 | + |
| 42 | +# New line preferences |
| 43 | +csharp_new_line_before_open_brace = all |
| 44 | +csharp_new_line_before_else = true |
| 45 | +csharp_new_line_before_catch = true |
| 46 | +csharp_new_line_before_finally = true |
| 47 | + |
| 48 | +# Indentation preferences |
| 49 | +csharp_indent_case_contents = true |
| 50 | +csharp_indent_switch_labels = true |
| 51 | + |
| 52 | +# Naming conventions |
| 53 | +dotnet_naming_rule.public_members_pascal_case.symbols = public_symbols |
| 54 | +dotnet_naming_rule.public_members_pascal_case.style = pascal_case_style |
| 55 | +dotnet_naming_rule.public_members_pascal_case.severity = suggestion |
| 56 | + |
| 57 | +dotnet_naming_symbols.public_symbols.applicable_kinds = class,struct,interface,enum,property,method,event,delegate |
| 58 | +dotnet_naming_symbols.public_symbols.applicable_accessibilities = public,internal |
| 59 | + |
| 60 | +dotnet_naming_style.pascal_case_style.capitalization = pascal_case |
| 61 | + |
| 62 | +dotnet_naming_rule.private_fields_camel_case.symbols = private_fields |
| 63 | +dotnet_naming_rule.private_fields_camel_case.style = camel_case_underscore_style |
| 64 | +dotnet_naming_rule.private_fields_camel_case.severity = suggestion |
| 65 | + |
| 66 | +dotnet_naming_symbols.private_fields.applicable_kinds = field |
| 67 | +dotnet_naming_symbols.private_fields.applicable_accessibilities = private |
| 68 | + |
| 69 | +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ |
| 70 | +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case |
0 commit comments