@@ -67,7 +67,7 @@ dotnet_style_readonly_field = true
6767dotnet_code_quality_unused_parameters = all
6868
6969# 禁止显示首选项
70- dotnet_remove_unnecessary_suppression_exclusions = 0
70+ dotnet_remove_unnecessary_suppression_exclusions = none
7171
7272# 新行首选项
7373dotnet_style_allow_multiple_blank_lines_experimental = false :suggestion
@@ -105,12 +105,14 @@ csharp_style_conditional_delegate_call = true
105105csharp_prefer_static_local_function = true
106106csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
107107csharp_style_prefer_readonly_struct = true
108+ csharp_style_prefer_readonly_struct_member = true
108109
109110# 代码块首选项
110111csharp_prefer_braces = true :suggestion
111112csharp_prefer_simple_using_statement = true
112113csharp_style_namespace_declarations = file_scoped:suggestion
113114csharp_style_prefer_method_group_conversion = true
115+ csharp_style_prefer_primary_constructors = true
114116csharp_style_prefer_top_level_statements = true
115117
116118# 表达式级首选项
@@ -125,7 +127,7 @@ csharp_style_prefer_range_operator = true
125127csharp_style_prefer_tuple_swap = true
126128csharp_style_prefer_utf8_string_literals = true
127129csharp_style_throw_expression = true
128- csharp_style_unused_value_assignment_preference = discard_variable:silent
130+ csharp_style_unused_value_assignment_preference = discard_variable
129131csharp_style_unused_value_expression_statement_preference = discard_variable
130132
131133# "using" 指令首选项
@@ -205,6 +207,10 @@ dotnet_naming_rule.抽象类_should_be_abstractmethod.severity = suggestion
205207dotnet_naming_rule.抽象类_should_be_abstractmethod.symbols = 抽象类
206208dotnet_naming_rule.抽象类_should_be_abstractmethod.style = abstractmethod
207209
210+ dotnet_naming_rule.常量_should_be_pascalcase.severity = suggestion
211+ dotnet_naming_rule.常量_should_be_pascalcase.symbols = 常量
212+ dotnet_naming_rule.常量_should_be_pascalcase.style = pascalcase
213+
208214dotnet_naming_rule.非字段成员_should_be_pascalcase.severity = suggestion
209215dotnet_naming_rule.非字段成员_should_be_pascalcase.symbols = 非字段成员
210216dotnet_naming_rule.非字段成员_should_be_pascalcase.style = pascalcase
@@ -271,6 +277,10 @@ dotnet_naming_symbols.异步方法.applicable_kinds = method, local_function
271277dotnet_naming_symbols.异步方法.applicable_accessibilities = *
272278dotnet_naming_symbols.异步方法.required_modifiers = async
273279
280+ dotnet_naming_symbols.常量.applicable_kinds = property, field
281+ dotnet_naming_symbols.常量.applicable_accessibilities = *
282+ dotnet_naming_symbols.常量.required_modifiers = const
283+
274284# 命名样式
275285
276286dotnet_naming_style.pascalcase.required_prefix =
0 commit comments