Skip to content

Commit caffa4e

Browse files
committed
Merge branch 'add-editorconfig'
2 parents c45bb39 + eec4d92 commit caffa4e

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.editorconfig

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

0 commit comments

Comments
 (0)