|
| 1 | +# Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\dev\dnp\blazor-workshop\src codebase based on best match to current usage at 3/28/2022 |
| 2 | +# You can modify the rules from these initially generated values to suit your own policies |
| 3 | +# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference |
| 4 | +[*.cs] |
| 5 | + |
| 6 | + |
| 7 | +#Formatting - new line options |
| 8 | + |
| 9 | +#place catch statements on a new line |
| 10 | +csharp_new_line_before_catch = true |
| 11 | +#place else statements on a new line |
| 12 | +csharp_new_line_before_else = true |
| 13 | +#require members of anonymous types to be on separate lines |
| 14 | +csharp_new_line_before_members_in_anonymous_types = true |
| 15 | +#require members of object intializers to be on separate lines |
| 16 | +csharp_new_line_before_members_in_object_initializers = true |
| 17 | +#require braces to be on a new line for methods, control_blocks, types, object_collection_array_initializers, and anonymous_types (also known as "Allman" style) |
| 18 | +csharp_new_line_before_open_brace = methods, control_blocks, types, object_collection_array_initializers, anonymous_types |
| 19 | + |
| 20 | +#Formatting - organize using options |
| 21 | + |
| 22 | +#sort System.* using directives alphabetically, and place them before other usings |
| 23 | +dotnet_sort_system_directives_first = true |
| 24 | + |
| 25 | +#Formatting - spacing options |
| 26 | + |
| 27 | +#require NO space between a cast and the value |
| 28 | +csharp_space_after_cast = false |
| 29 | +#require a space before the colon for bases or interfaces in a type declaration |
| 30 | +csharp_space_after_colon_in_inheritance_clause = true |
| 31 | +#require a space after a keyword in a control flow statement such as a for loop |
| 32 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 33 | +#require a space before the colon for bases or interfaces in a type declaration |
| 34 | +csharp_space_before_colon_in_inheritance_clause = true |
| 35 | +#remove space within empty argument list parentheses |
| 36 | +csharp_space_between_method_call_empty_parameter_list_parentheses = false |
| 37 | +#remove space between method call name and opening parenthesis |
| 38 | +csharp_space_between_method_call_name_and_opening_parenthesis = false |
| 39 | +#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call |
| 40 | +csharp_space_between_method_call_parameter_list_parentheses = false |
| 41 | +#remove space within empty parameter list parentheses for a method declaration |
| 42 | +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false |
| 43 | +#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. |
| 44 | +csharp_space_between_method_declaration_parameter_list_parentheses = false |
| 45 | + |
| 46 | +#Formatting - wrapping options |
| 47 | + |
| 48 | +#leave code block on single line |
| 49 | +csharp_preserve_single_line_blocks = true |
| 50 | + |
| 51 | +#Style - Code block preferences |
| 52 | + |
| 53 | +#prefer curly braces even for one line of code |
| 54 | +csharp_prefer_braces = true:suggestion |
| 55 | + |
| 56 | +#Style - expression bodied member options |
| 57 | + |
| 58 | +#prefer block bodies for constructors |
| 59 | +csharp_style_expression_bodied_constructors = false:suggestion |
| 60 | +#prefer block bodies for methods |
| 61 | +csharp_style_expression_bodied_methods = false:suggestion |
| 62 | +#prefer expression-bodied members for properties |
| 63 | +csharp_style_expression_bodied_properties = true:suggestion |
| 64 | + |
| 65 | +#Style - expression level options |
| 66 | + |
| 67 | +#prefer ItemX properties to tuple names |
| 68 | +dotnet_style_explicit_tuple_names = false:suggestion |
| 69 | +#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them |
| 70 | +dotnet_style_predefined_type_for_member_access = true:suggestion |
| 71 | + |
| 72 | +#Style - Expression-level preferences |
| 73 | + |
| 74 | +#prefer objects to be initialized using object initializers when possible |
| 75 | +dotnet_style_object_initializer = true:suggestion |
| 76 | +#prefer inferred anonymous type member names |
| 77 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion |
| 78 | +#prefer inferred tuple element names |
| 79 | +dotnet_style_prefer_inferred_tuple_names = true:suggestion |
| 80 | + |
| 81 | +#Style - implicit and explicit types |
| 82 | + |
| 83 | +#prefer var over explicit type in all cases, unless overridden by another code style rule |
| 84 | +csharp_style_var_elsewhere = true:suggestion |
| 85 | +#prefer var is used to declare variables with built-in system types such as int |
| 86 | +csharp_style_var_for_built_in_types = true:suggestion |
| 87 | +#prefer var when the type is already mentioned on the right-hand side of a declaration expression |
| 88 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 89 | + |
| 90 | +#Style - language keyword and framework type options |
| 91 | + |
| 92 | +#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them |
| 93 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 94 | + |
| 95 | +#Style - modifier options |
| 96 | + |
| 97 | +#prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods. |
| 98 | +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion |
| 99 | + |
| 100 | +#Style - Modifier preferences |
| 101 | + |
| 102 | +#when this rule is set to a list of modifiers, prefer the specified ordering. |
| 103 | +csharp_preferred_modifier_order = public,private,protected,static,async,readonly,override:suggestion |
| 104 | + |
| 105 | +#Style - qualification options |
| 106 | + |
| 107 | +#prefer fields not to be prefaced with this. or Me. in Visual Basic |
| 108 | +dotnet_style_qualification_for_field = false:suggestion |
| 109 | +#prefer methods not to be prefaced with this. or Me. in Visual Basic |
| 110 | +dotnet_style_qualification_for_method = false:suggestion |
| 111 | +#prefer properties not to be prefaced with this. or Me. in Visual Basic |
| 112 | +dotnet_style_qualification_for_property = false:suggestion |
| 113 | +csharp_using_directive_placement = outside_namespace:silent |
| 114 | +csharp_prefer_simple_using_statement = true:suggestion |
| 115 | +csharp_style_namespace_declarations = block_scoped:silent |
| 116 | +csharp_style_prefer_method_group_conversion = true:silent |
| 117 | +csharp_style_expression_bodied_operators = false:silent |
| 118 | +csharp_style_expression_bodied_indexers = true:silent |
| 119 | +csharp_style_expression_bodied_accessors = true:silent |
| 120 | +csharp_style_expression_bodied_lambdas = true:silent |
| 121 | +csharp_style_expression_bodied_local_functions = false:silent |
| 122 | +csharp_indent_labels = one_less_than_current |
| 123 | + |
| 124 | +[*.{cs,vb}] |
| 125 | +#### Naming styles #### |
| 126 | + |
| 127 | +# Naming rules |
| 128 | + |
| 129 | +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion |
| 130 | +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface |
| 131 | +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i |
| 132 | + |
| 133 | +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion |
| 134 | +dotnet_naming_rule.types_should_be_pascal_case.symbols = types |
| 135 | +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case |
| 136 | + |
| 137 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion |
| 138 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members |
| 139 | +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case |
| 140 | + |
| 141 | +# Symbol specifications |
| 142 | + |
| 143 | +dotnet_naming_symbols.interface.applicable_kinds = interface |
| 144 | +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 145 | +dotnet_naming_symbols.interface.required_modifiers = |
| 146 | + |
| 147 | +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum |
| 148 | +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 149 | +dotnet_naming_symbols.types.required_modifiers = |
| 150 | + |
| 151 | +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method |
| 152 | +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected |
| 153 | +dotnet_naming_symbols.non_field_members.required_modifiers = |
| 154 | + |
| 155 | +# Naming styles |
| 156 | + |
| 157 | +dotnet_naming_style.begins_with_i.required_prefix = I |
| 158 | +dotnet_naming_style.begins_with_i.required_suffix = |
| 159 | +dotnet_naming_style.begins_with_i.word_separator = |
| 160 | +dotnet_naming_style.begins_with_i.capitalization = pascal_case |
| 161 | + |
| 162 | +dotnet_naming_style.pascal_case.required_prefix = |
| 163 | +dotnet_naming_style.pascal_case.required_suffix = |
| 164 | +dotnet_naming_style.pascal_case.word_separator = |
| 165 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 166 | + |
| 167 | +dotnet_naming_style.pascal_case.required_prefix = |
| 168 | +dotnet_naming_style.pascal_case.required_suffix = |
| 169 | +dotnet_naming_style.pascal_case.word_separator = |
| 170 | +dotnet_naming_style.pascal_case.capitalization = pascal_case |
| 171 | +dotnet_style_coalesce_expression = true:suggestion |
| 172 | +dotnet_style_null_propagation = true:suggestion |
| 173 | +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion |
| 174 | +dotnet_style_prefer_auto_properties = true:silent |
| 175 | +dotnet_style_object_initializer = true:suggestion |
| 176 | +dotnet_style_collection_initializer = true:suggestion |
| 177 | +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion |
| 178 | +dotnet_style_prefer_conditional_expression_over_assignment = true:silent |
| 179 | +dotnet_style_prefer_conditional_expression_over_return = true:silent |
| 180 | +dotnet_style_explicit_tuple_names = false:suggestion |
| 181 | +dotnet_style_prefer_inferred_tuple_names = true:suggestion |
| 182 | +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion |
| 183 | +dotnet_style_prefer_compound_assignment = true:suggestion |
| 184 | +dotnet_style_operator_placement_when_wrapping = beginning_of_line |
| 185 | +indent_style = space |
| 186 | +tab_width = 4 |
| 187 | +indent_size = 4 |
| 188 | +end_of_line = crlf |
| 189 | +dotnet_style_prefer_simplified_interpolation = true:suggestion |
0 commit comments