.editorconfig 2.5 KB
Newer Older
S
Shapkin Arkady 已提交
1 2 3 4 5 6
# EditorConfig is awesome:
http://EditorConfig.org

# top-most EditorConfig file
root = true

7
# Don't use tabs for indentation.
S
Shapkin Arkady 已提交
8 9
[*]
indent_style = space
10 11 12 13
# (Please don't specify an indent_size here; that has too many unintended consequences.)

# Code files
[*.cs,*.csx,*.vb,*.vbx]
S
Shapkin Arkady 已提交
14 15 16 17 18 19 20 21 22
indent_size = 4

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2
23 24 25 26

# JSON files
[*.json]
indent_size = 2
27 28 29

# Dotnet code style settings:
[*.{cs, vb}]
30 31
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
32
# Avoid "this." and "Me." if not necessary
33 34 35 36
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
37

38
# Use language keywords instead of framework type names for type references
39 40
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
41 42

# Suggest more modern language features when available
43 44 45 46
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
47
dotnet_style_explicit_tuple_names = true:suggestion
48 49

# CSharp code style settings:
50
[*.cs]
51
# Prefer "var" everywhere
52 53
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
K
Kasey Uhlenhuth 已提交
54
csharp_style_var_elsewhere = true:suggestion
55 56

# Prefer method-like constructs to have a block body
57
csharp_style_expression_bodied_methods = false:none
58 59
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
60 61

# Prefer property-like constructs to have an expression-body
62 63 64
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
65 66

# Suggest more modern language features when available
67 68 69 70 71
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion