1
+ # EditorConfig is awesome:http://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ # Don't use tabs for indentation.
7
+ [* ]
8
+ indent_style = space
9
+ # (Please don't specify an indent_size here; that has too many unintended consequences.)
10
+
11
+ # Code files
12
+ [* .{cs,csx,vb,vbx} ]
13
+ indent_size = 4
14
+ insert_final_newline = true
15
+ charset = utf-8-bom
16
+
17
+ # Xml project files
18
+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
19
+ indent_size = 2
20
+
21
+ # Xml config files
22
+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
23
+ indent_size = 2
24
+
25
+ # JSON files
26
+ [* .json ]
27
+ indent_size = 2
28
+
29
+ # Dotnet code style settings:
30
+ [* .{cs,vb} ]
31
+ # Sort using and Import directives with System.* appearing first
32
+ dotnet_sort_system_directives_first = true
33
+ # Avoid "this." and "Me." if not necessary
34
+ dotnet_style_qualification_for_field = false :suggestion
35
+ dotnet_style_qualification_for_property = false :suggestion
36
+ dotnet_style_qualification_for_method = false :suggestion
37
+ dotnet_style_qualification_for_event = false :suggestion
38
+
39
+ # Use language keywords instead of framework type names for type references
40
+ dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
41
+ dotnet_style_predefined_type_for_member_access = true :suggestion
42
+
43
+ # Suggest more modern language features when available
44
+ dotnet_style_object_initializer = true :suggestion
45
+ dotnet_style_collection_initializer = true :suggestion
46
+ dotnet_style_coalesce_expression = true :suggestion
47
+ dotnet_style_null_propagation = true :suggestion
48
+ dotnet_style_explicit_tuple_names = true :suggestion
49
+
50
+ # CSharp code style settings:
51
+ [* .cs ]
52
+ # Prefer "var" everywhere
53
+ # csharp_style_var_for_built_in_types = true:suggestion
54
+ # csharp_style_var_when_type_is_apparent = false:suggestion
55
+ # csharp_style_var_elsewhere = true:suggestion
56
+
57
+ # Prefer method-like constructs to have a expression-body
58
+ csharp_style_expression_bodied_methods = true :none
59
+ csharp_style_expression_bodied_constructors = true :none
60
+ csharp_style_expression_bodied_operators = true :none
61
+
62
+ # Prefer property-like constructs to have an expression-body
63
+ csharp_style_expression_bodied_properties = true :none
64
+ csharp_style_expression_bodied_indexers = true :none
65
+ csharp_style_expression_bodied_accessors = true :none
66
+
67
+ # Suggest more modern language features when available
68
+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
69
+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
70
+ csharp_style_inlined_variable_declaration = true :suggestion
71
+ csharp_style_throw_expression = true :suggestion
72
+ csharp_style_conditional_delegate_call = true :suggestion
73
+
74
+ # Newline settings
75
+ csharp_new_line_before_open_brace = all
76
+ csharp_new_line_before_else = true
77
+ csharp_new_line_before_catch = true
78
+ csharp_new_line_before_finally = true
79
+ csharp_new_line_before_members_in_object_initializers = true
80
+ csharp_new_line_before_members_in_anonymous_types = true
0 commit comments