@@ -17,51 +17,11 @@ insert_final_newline = true
1717
1818# ### .NET Coding Conventions ####
1919
20- # Organize usings
21- dotnet_separate_import_directive_groups = false
22- dotnet_sort_system_directives_first = false
23-
24- # this. and Me. preferences
25- dotnet_style_qualification_for_event = true :suggestion
26- dotnet_style_qualification_for_field = true :suggestion
27- dotnet_style_qualification_for_method = true :suggestion
28- dotnet_style_qualification_for_property = true :suggestion
29-
30- # Language keywords vs BCL types preferences
31- dotnet_style_predefined_type_for_locals_parameters_members = true :suggestion
32- dotnet_style_predefined_type_for_member_access = true :suggestion
33-
34- # Parentheses preferences
35- dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
36- dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent
37- dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
38- dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
39-
40- # Modifier preferences
41- dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
42-
43- # Expression-level preferences
20+ # C#-only expression preferences. Language-agnostic dotnet_style_* / dotnet_code_quality_* /
21+ # dotnet_style_parentheses_* live under [*.{cs,vb}] below — do not re-declare them here.
4422csharp_style_deconstructed_variable_declaration = true :suggestion
4523csharp_style_inlined_variable_declaration = true :suggestion
4624csharp_style_throw_expression = true :suggestion
47- dotnet_style_coalesce_expression = true :suggestion
48- dotnet_style_collection_initializer = true :suggestion
49- dotnet_style_explicit_tuple_names = true :suggestion
50- dotnet_style_null_propagation = true :suggestion
51- dotnet_style_object_initializer = true :suggestion
52- dotnet_style_prefer_auto_properties = true :suggestion
53- dotnet_style_prefer_compound_assignment = true :suggestion
54- dotnet_style_prefer_conditional_expression_over_assignment = true :suggestion
55- dotnet_style_prefer_conditional_expression_over_return = true :suggestion
56- dotnet_style_prefer_inferred_anonymous_type_member_names = true :suggestion
57- dotnet_style_prefer_inferred_tuple_names = true :suggestion
58- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :suggestion
59-
60- # Field preferences
61- dotnet_style_readonly_field = true :warning
62-
63- # Parameter preferences
64- dotnet_code_quality_unused_parameters = all:warning
6525
6626# ### C# Coding Conventions ####
6727
@@ -72,11 +32,11 @@ csharp_style_var_when_type_is_apparent = true:suggestion
7232
7333# Expression-bodied members
7434csharp_style_expression_bodied_accessors = true :suggestion
75- csharp_style_expression_bodied_constructors = false : silent
35+ csharp_style_expression_bodied_constructors = true : suggestion
7636csharp_style_expression_bodied_indexers = true :suggestion
7737csharp_style_expression_bodied_lambdas = true :suggestion
7838csharp_style_expression_bodied_local_functions = true :suggestion
79- csharp_style_expression_bodied_methods = true :silent
39+ csharp_style_expression_bodied_methods = true :suggestion
8040csharp_style_expression_bodied_operators = true :suggestion
8141csharp_style_expression_bodied_properties = true :suggestion
8242
@@ -90,15 +50,17 @@ csharp_style_conditional_delegate_call = true:suggestion
9050
9151# Modifier preferences
9252csharp_prefer_static_local_function = true :suggestion
93- csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
53+ csharp_prefer_system_threading_lock = true :suggestion
54+ csharp_prefer_static_anonymous_function = true :suggestion
55+ csharp_style_prefer_unbound_generic_type_in_nameof = true :suggestion
56+ csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
9457
9558# Code-block preferences
96- csharp_prefer_braces = true :suggestion
59+ csharp_prefer_braces = false :suggestion
9760csharp_prefer_simple_using_statement = true :warning
9861
9962# Expression-level preferences
10063csharp_prefer_simple_default_expression = true :suggestion
101- csharp_style_pattern_local_over_anonymous_function = true :suggestion
10264csharp_style_prefer_index_operator = true :suggestion
10365csharp_style_prefer_range_operator = true :suggestion
10466csharp_style_unused_value_assignment_preference = discard_variable:suggestion
@@ -253,7 +215,7 @@ dotnet_naming_style.camelcase.required_prefix =
253215dotnet_naming_style.camelcase.required_suffix =
254216dotnet_naming_style.camelcase.word_separator =
255217dotnet_naming_style.camelcase.capitalization = camel_case
256- csharp_style_namespace_declarations = block_scoped:silent
218+ csharp_style_namespace_declarations = file_scoped:warning
257219csharp_style_prefer_method_group_conversion = true :silent
258220csharp_style_prefer_top_level_statements = true :silent
259221csharp_style_prefer_null_check_over_type_check = true :suggestion
@@ -319,7 +281,7 @@ dotnet_diagnostic.IDE1006.severity = suggestion
319281dotnet_diagnostic.IDE2000.severity = suggestion
320282dotnet_diagnostic.IDE2002.severity = suggestion
321283dotnet_diagnostic.IDE2004.severity = suggestion
322- csharp_style_prefer_local_over_anonymous_function = false :silent
284+ csharp_style_prefer_local_over_anonymous_function = false :suggestion
323285csharp_style_implicit_object_creation_when_type_is_apparent = true :suggestion
324286csharp_style_prefer_primary_constructors = true :suggestion
325287csharp_style_prefer_tuple_swap = true :suggestion
@@ -372,6 +334,14 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
372334dotnet_style_prefer_compound_assignment = true :suggestion
373335dotnet_style_prefer_simplified_interpolation = true :suggestion
374336dotnet_style_namespace_match_folder = true :suggestion
337+ # Organize usings (dotnet_* — relocated here from [*.cs])
338+ dotnet_separate_import_directive_groups = false
339+ dotnet_sort_system_directives_first = false
340+ # Added 2026 — present in the current .NET default, previously absent
341+ dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
342+ dotnet_style_prefer_non_hidden_explicit_cast_in_source = true
343+ dotnet_prefer_system_hash_code = true
344+ dotnet_remove_unnecessary_suppression_exclusions = none
375345dotnet_diagnostic.CA1000.severity = suggestion
376346dotnet_diagnostic.CA1010.severity = suggestion
377347dotnet_diagnostic.CA1036.severity = suggestion
0 commit comments