1
1
---
2
2
title : .NET language conventions for EditorConfig
3
- ms.date : 09/23/2019
3
+ ms.date : 03/31/2020
4
4
ms.topic : reference
5
5
dev_langs :
6
6
- CSharp
7
7
- VB
8
8
helpviewer_keywords :
9
9
- language code style rules [EditorConfig]
10
- author : TerryGLee
11
- ms.author : tglee
10
+ author : mikadumont
11
+ ms.author : midumont
12
12
manager : jillfra
13
13
ms.workload :
14
14
- dotnet
@@ -88,7 +88,6 @@ The style rules in this section are applicable to both C# and Visual Basic.
88
88
- dotnet\_ style\_ predefined\_ type\_ for\_ member_access
89
89
- [ Modifier preferences] ( #normalize-modifiers )
90
90
- dotnet\_ style\_ require\_ accessibility_modifiers
91
- - csharp\_ preferred\_ modifier_order
92
91
- visual\_ basic\_ preferred\_ modifier_order
93
92
- dotnet\_ style\_ readonly\_ field
94
93
- [ Parentheses preferences] ( #parentheses-preferences )
@@ -110,6 +109,7 @@ The style rules in this section are applicable to both C# and Visual Basic.
110
109
- [ "Null" checking preferences] ( #null-checking-preferences )
111
110
- dotnet\_ style\_ coalesce_expression
112
111
- dotnet\_ style\_ null_propagation
112
+ - dotnet\_ style\_ prefer\_ is\_ null\_ check\_ over\_ reference\_ equality\_ method
113
113
114
114
### <a name =" this-and-me " ></a >"This." and "Me." qualifiers
115
115
@@ -403,6 +403,43 @@ Public Class MyClass
403
403
End Class
404
404
```
405
405
406
+ #### visual_basic_style_unused_value_expression_statement_preference
407
+
408
+ |||
409
+ | -| -|
410
+ | ** Rule name** | visual_basic_style_unused_value_expression_statement_preference |
411
+ | ** Rule ID** | IDE0058 |
412
+ | ** Applicable languages** | Visual Basic |
413
+ | ** Values** | ` unused_local_variable:silent ` |
414
+ | ** Visual Studio default** | ` unused_local_variable:silent ` |
415
+
416
+ Code examples:
417
+
418
+ ``` vb
419
+ ' visual_basic_style_unused_value_expression_statement_preference = unused_local_variable:silent
420
+
421
+ Dim unused = Computation()
422
+ ```
423
+
424
+ #### visual_basic_style_unused_value_assignment_preference
425
+
426
+ |||
427
+ | -| -|
428
+ | ** Rule name** | visual_basic_style_unused_value_assignment_preference |
429
+ | ** Rule ID** | IDE0059 |
430
+ | ** Applicable languages** | Visual Basic |
431
+ | ** Values** | ` unused_local_variable:silent ` |
432
+ | ** Visual Studio default** | ` unused_local_variable:silent ` |
433
+
434
+ Code examples:
435
+
436
+ ``` vb
437
+ ' visual_basic_style_unused_value_assignment_preference = unused_local_variable:suggestion
438
+
439
+ Dim unused = Computation()
440
+ Dim x = 1 ;
441
+ ```
442
+
406
443
#### dotnet_style_readonly_field
407
444
408
445
|||
@@ -935,6 +972,7 @@ These rules could appear in an *.editorconfig* file as follows:
935
972
[*.{cs,vb}]
936
973
dotnet_style_coalesce_expression = true:suggestion
937
974
dotnet_style_null_propagation = true:suggestion
975
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
938
976
```
939
977
940
978
#### dotnet\_ style\_ coalesce_expression
@@ -997,6 +1035,16 @@ Dim v = If(o Is Nothing, Nothing, o.ToString()) ' or
997
1035
Dim v = If (o IsNot Nothing , o.ToString(), Nothing )
998
1036
```
999
1037
1038
+ ### dotnet\_ style\_ prefer\_ is\_ null\_ check\_ over\_ reference\_ equality\_ method
1039
+
1040
+ |||
1041
+ | -| -|
1042
+ | ** Rule name** | dotnet_style_prefer_is_null_check_over_reference_equality_method |
1043
+ | ** Rule ID** | IDE0041 |
1044
+ | ** Applicable languages** | C# 6.0+ and Visual Basic 14+ |
1045
+ | ** Values** | ` true ` - Prefer is null check over reference equality method<br /><br />` false ` - Prefer reference equality method over is null check |
1046
+ | ** Visual Studio default** | ` true:silent ` |
1047
+
1000
1048
## .NET code quality settings
1001
1049
1002
1050
The quality rules in this section apply to both C# and Visual Basic code. They're used to configure code analyzers that are built into the Visual Studio integrated development environment (IDE). For information about configuring FxCop analyzers with an EditorConfig file, see [ Configure FxCop analyzers] ( ../code-quality/configure-fxcop-analyzers.md ) .
@@ -1075,6 +1123,8 @@ The style rules in this section are applicable to C# only.
1075
1123
- [ "Null" checking preferences] ( #c-null-checking-preferences )
1076
1124
- csharp\_ style\_ throw_expression
1077
1125
- csharp\_ style\_ conditional\_ delegate_call
1126
+ - [ Modifier preferences] ( #normalize-modifiers )
1127
+ -csharp\_ preferred\_ modifier_order
1078
1128
- [ Code block preferences] ( #code-block-preferences )
1079
1129
- csharp\_ prefer_braces
1080
1130
- [ Unused value preferences] ( #unused-value-preferences )
0 commit comments