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