1+ # EditorConfig is awesome: https://EditorConfig.org
2+
3+ # top-most EditorConfig file
4+ root = true
5+
6+ # All files
7+ [* ]
8+ charset = utf-8
9+ end_of_line = crlf
10+ insert_final_newline = true
11+ trim_trailing_whitespace = true
12+
13+ # Code files
14+ [* .{cs,csx,vb,vbx} ]
15+ indent_style = space
16+ indent_size = 4
17+
18+ # XML project files
19+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
20+ indent_style = space
21+ indent_size = 2
22+
23+ # XML config files
24+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
25+ indent_style = space
26+ indent_size = 2
27+
28+ # JSON files
29+ [* .json ]
30+ indent_style = space
31+ indent_size = 2
32+
33+ # YAML files
34+ [* .{yml,yaml} ]
35+ indent_style = space
36+ indent_size = 2
37+
38+ # JavaScript files
39+ [* .{js,ts} ]
40+ indent_style = space
41+ indent_size = 2
42+
43+ # Markdown files
44+ [* .md ]
45+ trim_trailing_whitespace = false
46+
47+ # Batch files
48+ [* .{cmd,bat} ]
49+ end_of_line = crlf
50+
51+ # Shell files
52+ [* .sh ]
53+ end_of_line = lf
54+
55+ # .NET Code Style Rules
56+ [* .{cs,vb} ]
57+
58+ # Organize usings
59+ dotnet_separate_import_directive_groups = false
60+ dotnet_sort_system_directives_first = true
61+
62+ # this. preferences
63+ dotnet_style_qualification_for_field = false :suggestion
64+ dotnet_style_qualification_for_property = false :suggestion
65+ dotnet_style_qualification_for_method = false :suggestion
66+ dotnet_style_qualification_for_event = false :suggestion
67+
68+ # Language keywords vs BCL types preferences
69+ dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
70+ dotnet_style_predefined_type_for_member_access = true :suggestion
71+
72+ # Parentheses preferences
73+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
74+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
75+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
76+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
77+
78+ # Modifier preferences
79+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
80+ dotnet_style_readonly_field = true :suggestion
81+
82+ # Expression-level preferences
83+ dotnet_style_object_initializer = true :suggestion
84+ dotnet_style_collection_initializer = true :suggestion
85+ dotnet_style_explicit_tuple_names = true :suggestion
86+ dotnet_style_null_propagation = true :suggestion
87+ dotnet_style_coalesce_expression = true :suggestion
88+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
89+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
90+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
91+ dotnet_style_prefer_auto_properties = true :silent
92+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
93+ dotnet_style_prefer_conditional_expression_over_return = true :silent
94+
95+ # C# Code Style Rules
96+ [* .cs ]
97+
98+ # var preferences
99+ csharp_style_var_for_built_in_types = false :suggestion
100+ csharp_style_var_when_type_is_apparent = true :suggestion
101+ csharp_style_var_elsewhere = false :suggestion
102+
103+ # Expression-bodied members
104+ csharp_style_expression_bodied_methods = false :silent
105+ csharp_style_expression_bodied_constructors = false :silent
106+ csharp_style_expression_bodied_operators = false :silent
107+ csharp_style_expression_bodied_properties = true :silent
108+ csharp_style_expression_bodied_indexers = true :silent
109+ csharp_style_expression_bodied_accessors = true :silent
110+
111+ # Pattern matching preferences
112+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
113+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
114+
115+ # Null-checking preferences
116+ csharp_style_throw_expression = true :suggestion
117+ csharp_style_conditional_delegate_call = true :suggestion
118+
119+ # Modifier preferences
120+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
121+
122+ # Expression-level preferences
123+ csharp_prefer_braces = true :silent
124+ csharp_style_deconstructed_variable_declaration = true :suggestion
125+ csharp_prefer_simple_using_statement = true :suggestion
126+ csharp_style_prefer_switch_expression = true :suggestion
127+
128+ # C# Formatting Rules
129+ [* .cs ]
130+
131+ # New line preferences
132+ csharp_new_line_before_open_brace = all
133+ csharp_new_line_before_else = true
134+ csharp_new_line_before_catch = true
135+ csharp_new_line_before_finally = true
136+ csharp_new_line_before_members_in_object_initializers = true
137+ csharp_new_line_before_members_in_anonymous_types = true
138+ csharp_new_line_between_query_expression_clauses = true
139+
140+ # Indentation preferences
141+ csharp_indent_case_contents = true
142+ csharp_indent_switch_labels = true
143+ csharp_indent_labels = flush_left
144+
145+ # Space preferences
146+ csharp_space_after_cast = false
147+ csharp_space_after_keywords_in_control_flow_statements = true
148+ csharp_space_between_method_call_parameter_list_parentheses = false
149+ csharp_space_between_method_declaration_parameter_list_parentheses = false
150+ csharp_space_between_parentheses = false
151+ csharp_space_before_colon_in_inheritance_clause = true
152+ csharp_space_after_colon_in_inheritance_clause = true
153+ csharp_space_around_binary_operators = before_and_after
154+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
155+ csharp_space_between_method_call_name_and_opening_parenthesis = false
156+ csharp_space_between_method_call_empty_parameter_list_parentheses = false
157+
158+ # Wrapping preferences
159+ csharp_preserve_single_line_statements = true
160+ csharp_preserve_single_line_blocks = true
0 commit comments