|
| 1 | +# EditorConfig is awesome:http://EditorConfig.org |
| 2 | + |
| 3 | +# top-most EditorConfig file |
| 4 | +root = true |
| 5 | + |
| 6 | +# Baseline |
| 7 | +[*] |
| 8 | +charset = utf-8 |
| 9 | +indent_style = tab |
| 10 | +trim_trailing_whitespace = true |
| 11 | +max_line_length = 120 |
| 12 | + |
| 13 | +# MSBuild |
| 14 | +[*.{csproj,proj,projitems,shproj,fsproj,target,props}] |
| 15 | +indent_style = space |
| 16 | +indent_size = 2 |
| 17 | + |
| 18 | +# XML config files |
| 19 | +[*.{config,nuspec,resx}] |
| 20 | +indent_style = space |
| 21 | +indent_size = 2 |
| 22 | + |
| 23 | +# JSON files |
| 24 | +[*.json] |
| 25 | +indent_style = space |
| 26 | +indent_size = 2 |
| 27 | + |
| 28 | +# F# files |
| 29 | +[*.{fs, fsx, fsi}] |
| 30 | +indent_style = space |
| 31 | +indent_size = 4 |
| 32 | + |
| 33 | +# Dotnet code style settings: |
| 34 | +[*.{cs,vb}] |
| 35 | + |
| 36 | +# Sort using and Import directives with System.* appearing first |
| 37 | +dotnet_sort_system_directives_first = true |
| 38 | + |
| 39 | +# Avoid "this." and "Me." if not necessary |
| 40 | +dotnet_style_qualification_for_field = false:suggestion |
| 41 | +dotnet_style_qualification_for_property = false:suggestion |
| 42 | +dotnet_style_qualification_for_method = false:suggestion |
| 43 | +dotnet_style_qualification_for_event = false:suggestion |
| 44 | + |
| 45 | +# Use language keywords instead of framework type names for type references |
| 46 | +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion |
| 47 | +dotnet_style_predefined_type_for_member_access = true:suggestion |
| 48 | + |
| 49 | +# Suggest more modern language features when available |
| 50 | +dotnet_style_object_initializer = true:suggestion |
| 51 | +dotnet_style_collection_initializer = true:suggestion |
| 52 | +dotnet_style_coalesce_expression = true:suggestion |
| 53 | +dotnet_style_null_propagation = true:suggestion |
| 54 | +dotnet_style_explicit_tuple_names = true:suggestion |
| 55 | + |
| 56 | +# CSharp code style settings: |
| 57 | +[*.cs] |
| 58 | + |
| 59 | +# spaces before parens |
| 60 | +csharp_space_between_method_declaration_name_and_open_parenthesis = true |
| 61 | +csharp_space_between_method_call_name_and_opening_parenthesis = true |
| 62 | +csharp_space_after_keywords_in_control_flow_statements = true |
| 63 | + |
| 64 | +# Newline settings |
| 65 | +csharp_new_line_before_open_brace = types,methods |
| 66 | +csharp_new_line_before_else = false |
| 67 | +csharp_new_line_before_catch = false |
| 68 | +csharp_new_line_before_finally = false |
| 69 | +csharp_new_line_before_members_in_object_initializers = true |
| 70 | +csharp_new_line_before_members_in_anonymous_types = true |
| 71 | + |
| 72 | +# Switch indentation |
| 73 | +csharp_indent_switch_labels = false |
| 74 | + |
| 75 | +# Prefer "var" everywhere it's apparent |
| 76 | +csharp_style_var_for_built_in_types = true:suggestion |
| 77 | +csharp_style_var_when_type_is_apparent = true:suggestion |
| 78 | +csharp_style_var_elsewhere = true:suggestion |
| 79 | + |
| 80 | +# Prefer method-like constructs to have a block body |
| 81 | +csharp_style_expression_bodied_methods = false:none |
| 82 | +csharp_style_expression_bodied_constructors = false:none |
| 83 | +csharp_style_expression_bodied_operators = false:none |
| 84 | + |
| 85 | +# Prefer property-like constructs to have an expression-body |
| 86 | +csharp_style_expression_bodied_properties = true:none |
| 87 | +csharp_style_expression_bodied_indexers = true:none |
| 88 | +csharp_style_expression_bodied_accessors = true:none |
| 89 | + |
| 90 | +# Suggest more modern language features when available |
| 91 | +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion |
| 92 | +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion |
| 93 | +csharp_style_inlined_variable_declaration = true:suggestion |
| 94 | +csharp_style_throw_expression = true:suggestion |
| 95 | +csharp_style_conditional_delegate_call = true:suggestion |
0 commit comments