-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.editorconfig
96 lines (78 loc) · 3.22 KB
/
.editorconfig
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
# EditorConfig for Starsky
# https://editorconfig.org
root = true
[*]
# Most of the standard properties are supported
indent_size = 4
max_line_length = 100
end_of_line = lf
# Most frequently used .NET-coding-convention properties are supported
csharp_space_between_parentheses = expressions, type_casts, control_flow_statements
csharp_style_var_for_built_in_types = true
[*.{ts,tsx,json}]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.{js,cs,css,cshtml}]
charset = utf-8
indent_style = tab
insert_final_newline = true
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
[{*.yml,*.yaml,package.json}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
# C# files
[*.cs]
tab_width = 4
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_open_brace_for_methods = true
csharp_new_line_before_open_brace_for_control_blocks = true
csharp_preserve_single_line_statements = false
csharp_style_allow_embedded_statements_on_same_line_experimental = false
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
csharp_new_line_within_query_expression_clauses = true
csharp_wrap_before_eq = false
place_attribute_on_same_line = "never"
# csharp_style_namespace_declarations = file_scoped:warning
# https://dotnettips.wordpress.com/2023/06/27/microsoft-net-code-analysis-always-add-braces-in-c/
dotnet_diagnostic.IDE0011.severity = warning
csharp_prefer_braces = true:error
dotnet_diagnostic.SA1500.severity = warning
dotnet_diagnostic.SA1503.severity = warning
dotnet_diagnostic.SA1520.severity = warning
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_indent_case_contents_when_block = false
csharp_space_after_cast = true
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
# Unnecessary Code Rules
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/unnecessary-code-rules
dotnet_code_quality_unused_parameters = all:warning
dotnet_remove_unnecessary_suppression_exclusions = none:warning
dotnet_style_namespace_match_folder = true:suggestion
# unused usings (IDE0005)
dotnet_diagnostic.IDE0005.severity = warning
dotnet_diagnostic.IDE0028.severity = silent # IDE0028 = Simplify collection initialization
dotnet_diagnostic.IDE0051.severity = silent # Private member is unused
# CS4014: Because this call is not awaited, execution of the current method continues before the call is completed.
# Consider applying the 'await' operator to the result of the call.
dotnet_diagnostic.CS4014.severity = error
# IDE0077: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0077
dotnet_diagnostic.IDE0077.severity = error