-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.editorconfig
More file actions
80 lines (65 loc) · 2.81 KB
/
Copy path.editorconfig
File metadata and controls
80 lines (65 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{json,yml,yaml,xml,csproj,props,targets}]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[*.cs]
# Namespace
csharp_style_namespace_declarations = file_scoped:warning
# var preferences
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_methods = when_on_single_line:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Usings
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
csharp_using_directive_placement = outside_namespace:warning
# Nullable
dotnet_diagnostic.CS8600.severity = error
dotnet_diagnostic.CS8601.severity = error
dotnet_diagnostic.CS8602.severity = error
dotnet_diagnostic.CS8603.severity = error
dotnet_diagnostic.CS8604.severity = error
# Library docs — enforced on Core only via csproj
dotnet_diagnostic.CS1591.severity = suggestion
# Prefer braces
csharp_prefer_braces = true:suggestion
# Modern pattern preferences
csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
# Collection expressions
dotnet_style_prefer_collection_expression = true:suggestion
# Naming: interfaces start with I
dotnet_naming_rule.interfaces_begin_with_i.symbols = interface_symbol
dotnet_naming_rule.interfaces_begin_with_i.style = prefix_with_i
dotnet_naming_rule.interfaces_begin_with_i.severity = warning
dotnet_naming_symbols.interface_symbol.applicable_kinds = interface
dotnet_naming_style.prefix_with_i.capitalization = pascal_case
dotnet_naming_style.prefix_with_i.required_prefix = I
# Constants: PascalCase
dotnet_naming_rule.constants_pascal.symbols = constant_symbol
dotnet_naming_rule.constants_pascal.style = pascal_case_style
dotnet_naming_rule.constants_pascal.severity = suggestion
dotnet_naming_symbols.constant_symbol.applicable_kinds = field
dotnet_naming_symbols.constant_symbol.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Private fields: _camelCase
dotnet_naming_rule.private_fields_underscore.symbols = private_field_symbol
dotnet_naming_rule.private_fields_underscore.style = underscore_camel_case
dotnet_naming_rule.private_fields_underscore.severity = suggestion
dotnet_naming_symbols.private_field_symbol.applicable_kinds = field
dotnet_naming_symbols.private_field_symbol.applicable_accessibilities = private
dotnet_naming_style.underscore_camel_case.capitalization = camel_case
dotnet_naming_style.underscore_camel_case.required_prefix = _