1+ root = true
2+
3+ # All files
4+ [* ]
5+ charset = utf-8
6+ end_of_line = crlf
7+ trim_trailing_whitespace = true
8+ insert_final_newline = true
9+ indent_style = space
10+
11+ # Code files
12+ [* .{cs,csx,vb,vbx} ]
13+ indent_size = 4
14+
15+ # XML project files
16+ [* .{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj} ]
17+ indent_size = 2
18+
19+ # XML configuration files
20+ [* .{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct} ]
21+ indent_size = 2
22+
23+ # JSON files
24+ [* .{json,json5} ]
25+ indent_size = 2
26+
27+ # YAML files
28+ [* .{yml,yaml} ]
29+ indent_size = 2
30+
31+ # Markdown files
32+ [* .md ]
33+ trim_trailing_whitespace = false
34+
35+ # Web files
36+ [* .{htm,html,js,ts,tsx,css,sass,scss,less,svg} ]
37+ indent_size = 2
38+
39+ # Batch files
40+ [* .{cmd,bat} ]
41+ end_of_line = crlf
42+
43+ # Bash files
44+ [* .sh ]
45+ end_of_line = lf
46+
47+ # ##############################
48+ # .NET Coding Conventions #
49+ # ##############################
50+
51+ [* .{cs,vb} ]
52+
53+ # Organize usings
54+ dotnet_sort_system_directives_first = true
55+ dotnet_separate_import_directive_groups = false
56+
57+ # this. preferences
58+ dotnet_style_qualification_for_field = false :suggestion
59+ dotnet_style_qualification_for_property = false :suggestion
60+ dotnet_style_qualification_for_method = false :suggestion
61+ dotnet_style_qualification_for_event = false :suggestion
62+
63+ # Language keywords vs BCL types preferences
64+ dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
65+ dotnet_style_predefined_type_for_member_access = true :suggestion
66+
67+ # Parentheses preferences
68+ dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
69+ dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
70+ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
71+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
72+
73+ # Modifier preferences
74+ dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
75+ dotnet_style_readonly_field = true :suggestion
76+
77+ # Expression-level preferences
78+ dotnet_style_object_initializer = true :suggestion
79+ dotnet_style_collection_initializer = true :suggestion
80+ dotnet_style_explicit_tuple_names = true :suggestion
81+ dotnet_style_null_propagation = true :suggestion
82+ dotnet_style_coalesce_expression = true :suggestion
83+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
84+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
85+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
86+ dotnet_style_prefer_auto_properties = true :suggestion
87+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
88+ dotnet_style_prefer_conditional_expression_over_return = true :silent
89+
90+ # ##############################
91+ # Naming Conventions #
92+ # ##############################
93+
94+ # Style Definitions
95+ dotnet_naming_style.pascal_case_style.capitalization = pascal_case
96+
97+ # Use PascalCase for constant fields
98+ dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
99+ dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
100+ dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
101+ dotnet_naming_symbols.constant_fields.applicable_kinds = field
102+ dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
103+ dotnet_naming_symbols.constant_fields.required_modifiers = const
104+
105+ # ##############################
106+ # C# Coding Conventions #
107+ # ##############################
108+
109+ [* .cs ]
110+
111+ # var preferences
112+ csharp_style_var_for_built_in_types = false :suggestion
113+ csharp_style_var_when_type_is_apparent = true :suggestion
114+ csharp_style_var_elsewhere = false :suggestion
115+
116+ # Expression-bodied members
117+ csharp_style_expression_bodied_methods = false :silent
118+ csharp_style_expression_bodied_constructors = false :silent
119+ csharp_style_expression_bodied_operators = false :silent
120+ csharp_style_expression_bodied_properties = true :suggestion
121+ csharp_style_expression_bodied_indexers = true :suggestion
122+ csharp_style_expression_bodied_accessors = true :suggestion
123+
124+ # Pattern matching preferences
125+ csharp_style_pattern_matching_over_is_with_cast_check = true :suggestion
126+ csharp_style_pattern_matching_over_as_with_null_check = true :suggestion
127+
128+ # Null-checking preferences
129+ csharp_style_throw_expression = true :suggestion
130+ csharp_style_conditional_delegate_call = true :suggestion
131+
132+ # Modifier preferences
133+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
134+
135+ # Expression-level preferences
136+ csharp_prefer_braces = true :silent
137+ csharp_style_deconstructed_variable_declaration = true :suggestion
138+ csharp_prefer_simple_using_statement = true :suggestion
139+ csharp_style_prefer_switch_expression = true :suggestion
140+
141+ # ##############################
142+ # C# Formatting Rules #
143+ # ##############################
144+
145+ # New line preferences
146+ csharp_new_line_before_open_brace = all
147+ csharp_new_line_before_else = true
148+ csharp_new_line_before_catch = true
149+ csharp_new_line_before_finally = true
150+ csharp_new_line_before_members_in_object_initializers = true
151+ csharp_new_line_before_members_in_anonymous_types = true
152+ csharp_new_line_between_query_expression_clauses = true
153+
154+ # Indentation preferences
155+ csharp_indent_case_contents = true
156+ csharp_indent_switch_labels = true
157+ csharp_indent_labels = flush_left
158+
159+ # Space preferences
160+ csharp_space_after_cast = false
161+ csharp_space_after_keywords_in_control_flow_statements = true
162+ csharp_space_between_method_call_parameter_list_parentheses = false
163+ csharp_space_between_method_declaration_parameter_list_parentheses = false
164+ csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
165+ csharp_space_between_method_call_name_and_opening_parenthesis = false
166+ csharp_space_after_comma = true
167+ csharp_space_after_dot = false
168+ csharp_space_after_semicolon_in_for_statement = true
169+ csharp_space_around_binary_operators = before_and_after
170+ csharp_space_around_declaration_statements = false
171+ csharp_space_before_open_square_brackets = false
172+ csharp_space_between_empty_square_brackets = false
173+ csharp_space_between_square_brackets = false
174+
175+ # Wrapping preferences
176+ csharp_preserve_single_line_statements = true
177+ csharp_preserve_single_line_blocks = true
178+
179+ # ##############################
180+ # VB Coding Conventions #
181+ # ##############################
182+
183+ [* .vb ]
184+ # Modifier preferences
185+ visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
0 commit comments