.editorconfig 2.3 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
# Avoid "this." unless absolutely necessary
31 32 33 34
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
35 36

# Use language keywords instead of BCL types for type references
37 38
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
39 40

# Suggest more modern language features when available
41 42 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

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

# Prefer method-like constructs to have a block body
54
csharp_style_expression_bodied_methods = false:none
55 56
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none
57 58

# Prefer property-like constructs to have an expression-body
59 60 61
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none
62 63

# Suggest more modern language features when available
64 65 66 67 68
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