-
-
Notifications
You must be signed in to change notification settings - Fork 524
Expand file tree
/
Copy path.editorconfig
More file actions
executable file
·84 lines (62 loc) · 3.03 KB
/
.editorconfig
File metadata and controls
executable file
·84 lines (62 loc) · 3.03 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
# top-most EditorConfig file
root = true
###########################################################
# Core EditorConfig Settings - Apply to ALL files
###########################################################
[*]
# Indentation and spacing
indent_style = space
indent_size = 4
tab_width = 4
# Newline preferences
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
###########################################################
# .NET / C# Code Style Rules
###########################################################
[*.cs]
#### C# Language Style Rules (csharp_style_) ####
# Use "var" when the type is obvious or when a tuple/anonymous type
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_obvious = true:suggestion
csharp_style_var_elsewhere = false:suggestion
# Use file-scoped namespaces (if targeting .NET 6+)
csharp_style_namespace_declarations = file_scoped:warning
# Use pattern matching for 'is' and 'switch'
csharp_style_pattern_matching_over_is_with_not_null = true:suggestion
csharp_style_pattern_matching_over_as = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
# Use explicit type for arrays
csharp_style_explicit_array_type = true:suggestion
# Use simplified accessors (e.g., private set)
csharp_style_expression_bodied_accessors = false:suggestion
csharp_style_expression_bodied_properties = false:suggestion
csharp_style_expression_bodied_methods = false:suggestion
# Prefer to use `_` or `this.` for member access
csharp_prefer_static_local_function = true:suggestion
csharp_style_qualification_for_field = false:suggestion
csharp_style_qualification_for_property = false:suggestion
csharp_style_qualification_for_method = false:suggestion
csharp_style_qualification_for_event = false:suggestion
# Prefer throwing an exception over returning null (if applicable)
csharp_style_throw_expression = true:suggestion
#### .NET Language Style Rules (dotnet_style_) ####
# Use 'using' declarations instead of using statements
dotnet_style_prefer_dispose_pattern = true:suggestion
# Prefer collection expressions for arrays and lists (if targeting C# 12+)
dotnet_style_prefer_collection_expression = true:suggestion
# Prefer to use C# built-in type names (e.g., 'int' instead of 'Int32')
dotnet_style_predefined_type_names = true:suggestion
#### Formatting Rules (csharp_space_, csharp_indent_) ####
# Control spacing around binary operators (e.g., `a = b` vs `a=b`)
csharp_space_around_binary_operators = true:suggestion
# Control space within parentheses (e.g., `( a )` vs `(a)`)
csharp_space_within_parentheses = false:suggestion
# Control new line for braces (e.g., `if () {` vs `if () \n {`)
csharp_new_line_before_open_brace = all:suggestion
csharp_new_line_before_members_in_classes = true:suggestion
csharp_new_line_before_members_in_structs = true:suggestion
# Ensure using directives are sorted alphabetically
csharp_using_directive_placement = inside_namespace:suggestion