@@ -15,6 +15,33 @@ trim_trailing_whitespace = true
1515# Generated code
1616[* {_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs} ]
1717generated_code = true
18+ dotnet_style_operator_placement_when_wrapping = beginning_of_line
19+ tab_width = 4
20+ end_of_line = crlf
21+ dotnet_style_coalesce_expression = true :suggestion
22+ dotnet_style_null_propagation = true :suggestion
23+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
24+ dotnet_style_prefer_auto_properties = true :suggestion
25+ dotnet_style_object_initializer = true :suggestion
26+ dotnet_style_collection_initializer = true :suggestion
27+ dotnet_style_prefer_simplified_boolean_expressions = true :suggestion
28+ dotnet_style_prefer_conditional_expression_over_assignment = true :silent
29+ dotnet_style_prefer_conditional_expression_over_return = true :silent
30+ dotnet_style_explicit_tuple_names = true :suggestion
31+ dotnet_style_prefer_inferred_tuple_names = true :suggestion
32+ dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
33+ dotnet_style_prefer_compound_assignment = true :suggestion
34+ dotnet_style_prefer_simplified_interpolation = true :suggestion
35+ dotnet_style_prefer_collection_expression = when_types_exactly_match:suggestion
36+ dotnet_style_namespace_match_folder = true :suggestion
37+ dotnet_style_readonly_field = true :suggestion
38+
39+ # JSON files
40+ [* .json ]
41+ insert_final_newline = true
42+ indent_style = space
43+ indent_size = 2
44+ trim_trailing_whitespace = true
1845
1946# C# files
2047[* .cs ]
@@ -31,12 +58,12 @@ csharp_new_line_between_query_expression_clauses = true
3158csharp_indent_block_contents = true
3259csharp_indent_braces = false
3360csharp_indent_case_contents = true
34- csharp_indent_case_contents_when_block = true
61+ csharp_indent_case_contents_when_block = false
3562csharp_indent_switch_labels = true
3663csharp_indent_labels = one_less_than_current
3764
3865# Modifier preferences
39- csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
66+ csharp_preferred_modifier_order = public,private,protected,internal,file, static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required ,volatile,async:suggestion
4067
4168# avoid this. unless absolutely necessary
4269dotnet_style_qualification_for_field = false :suggestion
@@ -45,24 +72,24 @@ dotnet_style_qualification_for_method = false:suggestion
4572dotnet_style_qualification_for_event = false :suggestion
4673
4774# Types: use keywords instead of BCL types, and permit var only when the type is clear
48- csharp_style_var_for_built_in_types = false :suggestion
49- csharp_style_var_when_type_is_apparent = false : none
50- csharp_style_var_elsewhere = false :suggestion
75+ csharp_style_var_for_built_in_types = true :suggestion
76+ csharp_style_var_when_type_is_apparent = true : suggestion
77+ csharp_style_var_elsewhere = true :suggestion
5178dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
5279dotnet_style_predefined_type_for_member_access = true :suggestion
5380
5481# name all constant fields using PascalCase
5582dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
5683dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
57- dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
84+ dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
5885dotnet_naming_symbols.constant_fields.applicable_kinds = field
5986dotnet_naming_symbols.constant_fields.required_modifiers = const
6087dotnet_naming_style.pascal_case_style.capitalization = pascal_case
6188
6289# static fields should have s_ prefix
6390dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
6491dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
65- dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
92+ dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
6693dotnet_naming_symbols.static_fields.applicable_kinds = field
6794dotnet_naming_symbols.static_fields.required_modifiers = static
6895dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
@@ -72,7 +99,7 @@ dotnet_naming_style.static_prefix_style.capitalization = camel_case
7299# internal and private fields should be _camelCase
73100dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
74101dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
75- dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
102+ dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
76103dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
77104dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
78105dotnet_naming_style.camel_case_underscore_style.required_prefix = _
@@ -88,10 +115,21 @@ csharp_prefer_static_local_function = true:suggestion
88115csharp_prefer_simple_using_statement = false :none
89116csharp_style_prefer_switch_expression = true :suggestion
90117dotnet_style_readonly_field = true :suggestion
118+ csharp_style_namespace_declarations = block_scoped:silent
119+ csharp_style_prefer_method_group_conversion = true :silent
120+ csharp_style_prefer_top_level_statements = true :silent
121+ csharp_style_prefer_primary_constructors = true :suggestion
122+ csharp_style_prefer_null_check_over_type_check = true :suggestion
123+ csharp_style_prefer_local_over_anonymous_function = true :suggestion
124+ csharp_style_implicit_object_creation_when_type_is_apparent = true :suggestion
125+ csharp_style_prefer_tuple_swap = true :suggestion
126+ csharp_style_deconstructed_variable_declaration = true :suggestion
127+ csharp_prefer_system_threading_lock = true :suggestion
91128
92129# Expression-level preferences
93130dotnet_style_object_initializer = true :suggestion
94131dotnet_style_collection_initializer = true :suggestion
132+ dotnet_style_prefer_collection_expression = when_types_exactly_match
95133dotnet_style_explicit_tuple_names = true :suggestion
96134dotnet_style_coalesce_expression = true :suggestion
97135dotnet_style_null_propagation = true :suggestion
0 commit comments