Skip to content

Commit 8bcc9e9

Browse files
committed
Update editorconfig rules for VS2017.
Most of VS2017's defaults are kept, but they're made explicit in this file so it doesn't matter if the defaults have been changed locally.
1 parent c7664c9 commit 8bcc9e9

File tree

1 file changed

+61
-5
lines changed

1 file changed

+61
-5
lines changed

.editorconfig

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,68 @@
1+
root = true
2+
13
[*]
2-
end_of_line = lf
34
charset = utf-8
4-
indent_style = tab
5-
insert_final_newline = true
5+
indent_style = space
6+
indent_size = 2
67
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
11+
[*.csproj]
12+
insert_final_newline = false
713

814
[*.cs]
15+
indent_style = tab
916
indent_size = 4
1017

11-
[*.json]
12-
indent_size = 2
18+
# changes from VS2017 defaults
19+
csharp_style_expression_bodied_methods = true:suggestion
20+
csharp_style_expression_bodied_constructors = true:suggestion
21+
csharp_style_expression_bodied_operators = true:suggestion
22+
csharp_prefer_braces = false:none
23+
csharp_indent_switch_labels = false
24+
csharp_space_after_cast = true
25+
csharp_preserve_single_line_statements = false
26+
27+
# use VS2017 defaults, but make them warnings (instead of none)
28+
dotnet_style_qualification_for_field = false:warning
29+
dotnet_style_qualification_for_property = false:warning
30+
dotnet_style_qualification_for_method = false:warning
31+
dotnet_style_qualification_for_event = false:warning
32+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
33+
dotnet_style_explicit_tuple_names = true:warning
34+
dotnet_style_coalesce_expression = true:warning
35+
36+
# use VS2017 defaults, but make them suggestions (instead of none)
37+
csharp_style_var_for_built_in_types = true:suggestion
38+
csharp_style_var_when_type_is_apparent = true:suggestion
39+
csharp_style_var_elsewhere = true:suggestion
40+
csharp_style_expression_bodied_properties = true:suggestion
41+
csharp_style_expression_bodied_indexers = true:suggestion
42+
csharp_style_expression_bodied_accessors = true:suggestion
43+
44+
# explicitly use VS2017 defaults
45+
dotnet_style_object_initializer = true:suggestion
46+
dotnet_style_collection_initializer = true:suggestion
47+
dotnet_style_null_propagation = true:suggestion
48+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
49+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
50+
csharp_style_inlined_variable_declaration = true:suggestion
51+
csharp_prefer_simple_default_expression = true:suggestion
52+
csharp_style_throw_expression = true:suggestion
53+
csharp_style_conditional_delegate_call = true:suggestion
54+
dotnet_sort_system_directives_first = true
55+
csharp_new_line_before_open_brace = all
56+
csharp_new_line_before_else = true
57+
csharp_new_line_before_catch = true
58+
csharp_new_line_before_finally = true
59+
csharp_new_line_before_members_in_object_initializers = true
60+
csharp_new_line_before_members_in_anonymous_types = true
61+
csharp_new_line_within_query_expression_clauses = true
62+
csharp_indent_case_contents = true
63+
csharp_indent_labels = one_less
64+
csharp_space_after_keywords_in_control_flow_statements = true
65+
csharp_space_between_method_declaration_parameter_list_parentheses = false
66+
csharp_space_between_method_call_parameter_list_parentheses = false
67+
csharp_space_between_parentheses = false
68+
csharp_preserve_single_line_blocks = true

0 commit comments

Comments
 (0)