|
| 1 | +# Remove the line below if you want to inherit .editorconfig settings from higher directories |
| 2 | +root = true |
| 3 | + |
| 4 | +[*] |
| 5 | +indent_style = space |
| 6 | +indent_size = 4 |
| 7 | +charset = utf-8 |
| 8 | +trim_trailing_whitespace = true |
| 9 | +end_of_line = lf |
| 10 | +insert_final_newline = true |
| 11 | + |
| 12 | +[*.{csproj,json}] |
| 13 | +indent_size = 2 |
| 14 | + |
| 15 | +[*.{cs}] |
| 16 | +#### .NET Coding Conventions #### |
| 17 | + |
| 18 | +# Organize usings |
| 19 | +dotnet_sort_system_directives_first = true |
| 20 | + |
| 21 | +# this. preferences |
| 22 | +dotnet_style_qualification_for_field = false:suggestion |
| 23 | +dotnet_style_qualification_for_property = false:suggestion |
| 24 | +dotnet_style_qualification_for_method = false:suggestion |
| 25 | +dotnet_style_qualification_for_event = false:suggestion |
| 26 | + |
| 27 | +# Language keywords vs BCL types preferences |
| 28 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 29 | +dotnet_style_predefined_type_for_member_access = true:suggestion |
| 30 | + |
| 31 | +# Modifier preferences |
| 32 | +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion |
| 33 | +csharp_style_pattern_local_over_anonymous_function = false:silent |
| 34 | + |
| 35 | +# Expression-level preferences |
| 36 | +dotnet_style_operator_placement_when_wrapping = end_of_line |
| 37 | +dotnet_style_prefer_auto_properties = true:suggestion |
| 38 | +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion |
| 39 | +dotnet_style_prefer_conditional_expression_over_return = true:suggestion |
| 40 | + |
| 41 | +# Parameter preferences |
| 42 | +dotnet_code_quality_unused_parameters = non_public:suggestion |
| 43 | + |
| 44 | +# Expression-bodied members |
| 45 | +csharp_style_expression_bodied_accessors = true:suggestion |
| 46 | +csharp_style_expression_bodied_constructors = false:suggestion |
| 47 | +csharp_style_expression_bodied_indexers = true:suggestion |
| 48 | +csharp_style_expression_bodied_lambdas = true:suggestion |
| 49 | +csharp_style_expression_bodied_local_functions = false:suggestion |
| 50 | +csharp_style_expression_bodied_methods = false:suggestion |
| 51 | +csharp_style_expression_bodied_operators = false:suggestion |
| 52 | +csharp_style_expression_bodied_properties = true:suggestion |
| 53 | + |
| 54 | +# Code-block preferences |
| 55 | +csharp_prefer_braces = true:suggestion |
| 56 | + |
| 57 | +# Expression-level preferences |
| 58 | +csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion |
| 59 | + |
| 60 | +# 'using' directive preferences |
| 61 | +csharp_using_directive_placement = outside_namespace:suggestion |
| 62 | + |
| 63 | + |
| 64 | +#### C# Formatting Rules #### |
| 65 | + |
| 66 | +# Indentation preferences |
| 67 | +csharp_indent_case_contents_when_block = false |
| 68 | + |
| 69 | +# Wrapping preferences |
| 70 | +csharp_preserve_single_line_statements = false |
| 71 | + |
| 72 | + |
| 73 | +#### Naming styles #### |
| 74 | + |
| 75 | +dotnet_diagnostic.IDE1006.severity = warning |
| 76 | + |
| 77 | +# Naming rules |
| 78 | +dotnet_naming_rule.private_const_fields_should_be_pascal_case.symbols = private_const_fields |
| 79 | +dotnet_naming_rule.private_const_fields_should_be_pascal_case.style = pascal_case |
| 80 | +dotnet_naming_rule.private_const_fields_should_be_pascal_case.severity = warning |
| 81 | + |
| 82 | +dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.symbols = private_static_readonly_fields |
| 83 | +dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.style = pascal_case |
| 84 | +dotnet_naming_rule.private_static_readonly_fields_should_be_pascal_case.severity = warning |
| 85 | + |
| 86 | +dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.symbols = private_static_or_readonly_fields |
| 87 | +dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.style = camel_case_prefix_with_underscore |
| 88 | +dotnet_naming_rule.private_static_or_readonly_fields_should_start_with_underscore.severity = warning |
| 89 | + |
| 90 | +dotnet_naming_rule.locals_and_parameters_should_be_camel_case.symbols = locals_and_parameters |
| 91 | +dotnet_naming_rule.locals_and_parameters_should_be_camel_case.style = camel_case |
| 92 | +dotnet_naming_rule.locals_and_parameters_should_be_camel_case.severity = warning |
| 93 | + |
| 94 | +dotnet_naming_rule.types_and_members_should_be_pascal_case.symbols = types_and_members |
| 95 | +dotnet_naming_rule.types_and_members_should_be_pascal_case.style = pascal_case |
| 96 | +dotnet_naming_rule.types_and_members_should_be_pascal_case.severity = warning |
| 97 | + |
| 98 | +# Symbol specifications |
| 99 | +dotnet_naming_symbols.private_const_fields.applicable_kinds = field |
| 100 | +dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private |
| 101 | +dotnet_naming_symbols.private_const_fields.required_modifiers = const |
| 102 | + |
| 103 | +dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field |
| 104 | +dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private |
| 105 | +dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static,readonly |
| 106 | + |
| 107 | +dotnet_naming_symbols.private_static_or_readonly_fields.applicable_kinds = field |
| 108 | +dotnet_naming_symbols.private_static_or_readonly_fields.applicable_accessibilities = private |
| 109 | +dotnet_naming_symbols.private_static_or_readonly_fields.required_modifiers = static readonly |
| 110 | + |
| 111 | +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = local,parameter |
| 112 | +dotnet_naming_symbols.locals_and_parameters.applicable_accessibilities = * |
| 113 | + |
| 114 | +dotnet_naming_symbols.types_and_members.applicable_kinds = * |
| 115 | +dotnet_naming_symbols.types_and_members.applicable_accessibilities = * |
| 116 | + |
| 117 | +# Naming styles |
| 118 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 119 | + |
| 120 | +dotnet_naming_style.camel_case_prefix_with_underscore.required_prefix = _ |
| 121 | +dotnet_naming_style.camel_case_prefix_with_underscore.capitalization = camel_case |
| 122 | + |
| 123 | +dotnet_naming_style.camel_case.capitalization = camel_case |
0 commit comments