-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.editorconfig
More file actions
116 lines (87 loc) · 4.27 KB
/
Copy path.editorconfig
File metadata and controls
116 lines (87 loc) · 4.27 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
root = true
############################
# Global editor basics
############################
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
############################
# C# formatting & style
############################
[*.cs]
# Braces: avoid single-line control statements
csharp_prefer_braces = true:warning
# "using" organization
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
# Prefer file-scoped namespaces (common in modern codebases)
csharp_style_namespace_declarations = file_scoped:warning
# Prefer expression-bodied only when it stays readable
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
# Remove "this." unless needed (reduces visual noise)
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
# Prefer pattern matching / modern null checks
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Prefer simplified constructs
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
# Explicit accessibility is common in larger codebases
dotnet_style_require_accessibility_modifiers = always:warning
# Prefer readonly where possible (helps correctness)
dotnet_style_readonly_field = true:suggestion
# If you like primary constructors / etc later, keep suggestions not warnings first
# (Add more rules as your team adopts newer features)
############################
# Analyzer severities (common enterprise knobs)
############################
# "Add braces" diagnostic (backs csharp_prefer_braces)
dotnet_diagnostic.IDE0011.severity = warning
# Remove unnecessary usings
dotnet_diagnostic.IDE0005.severity = warning
# Prefer 'is null' checks where relevant
dotnet_diagnostic.IDE0041.severity = suggestion
# Use LoggerMessage delegates for better performance (disabled)
dotnet_diagnostic.CA1848.severity = none
dotnet_diagnostic.CA1822.severity = none
# Naming: you’ll usually add rules (below)
# Interfaces must start with I
dotnet_naming_rule.interfaces_should_be_prefixed.severity = warning
dotnet_naming_rule.interfaces_should_be_prefixed.symbols = interfaces
dotnet_naming_rule.interfaces_should_be_prefixed.style = prefix_I
dotnet_naming_symbols.interfaces.applicable_kinds = interface
dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
dotnet_naming_symbols.interfaces.required_modifiers =
dotnet_naming_style.prefix_I.required_prefix = I
dotnet_naming_style.prefix_I.capitalization = pascal_case
# Private constants/statics should be PascalCase
dotnet_naming_rule.private_const_fields_pascal.severity = warning
dotnet_naming_rule.private_const_fields_pascal.symbols = private_const_fields
dotnet_naming_rule.private_const_fields_pascal.style = pascal_case_style
dotnet_naming_symbols.private_const_fields.applicable_kinds = field
dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_const_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Private instance fields (and static non-const) should be _camelCase
dotnet_naming_rule.private_fields_underscore.severity = warning
dotnet_naming_rule.private_fields_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_underscore.style = underscore_camel
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_fields.required_modifiers =
dotnet_naming_style.underscore_camel.required_prefix = _
dotnet_naming_style.underscore_camel.capitalization = camel_case
dotnet_diagnostic.IDE0005.severity = error
dotnet_diagnostic.IDE0051.severity = error
dotnet_diagnostic.IDE0052.severity = error
dotnet_diagnostic.IDE0060.severity = error
dotnet_diagnostic.CA1801.severity = error
dotnet_diagnostic.CA1811.severity = error