Skip to content

Commit 5b51e45

Browse files
authored
Update lint rules (#4904)
1 parent d08ab52 commit 5b51e45

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.editorconfig

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,48 @@ dotnet_diagnostic.IDE0017.severity = suggestion
7070
# IDE0018: Variable declaration can be inlined
7171
dotnet_diagnostic.IDE0018.severity = suggestion
7272

73+
# IDE0019: Use pattern matching to avoid as followed by a null check
74+
dotnet_diagnostic.IDE0019.severity = warning
75+
76+
# IDE0020: Use pattern matching to avoid 'is' check followed by a cast (with variable)
77+
dotnet_diagnostic.IDE0020.severity = warning
78+
7379
# IDE0022: Use block body for method
7480
dotnet_diagnostic.IDE0022.severity = none
7581

82+
# IDE0025: Use expression body for property
83+
dotnet_diagnostic.IDE0025.severity = suggestion
84+
7685
# IDE0027: Use expression body for accessor
7786
dotnet_diagnostic.IDE0027.severity = suggestion
7887

7988
# IDE0028: Simplify collection initialization
8089
dotnet_diagnostic.IDE0028.severity = suggestion
8190

91+
# IDE0029: Null check can be simplified (ternary conditional check)
92+
dotnet_diagnostic.IDE0029.severity = suggestion
93+
94+
# IDE0030: Null check can be simplified (nullable ternary conditional check)
95+
dotnet_diagnostic.IDE0030.severity = suggestion
96+
97+
# IDE0031: Use null propagation
98+
dotnet_diagnostic.IDE0031.severity = suggestion
99+
82100
# IDE0032: Use auto property
83101
dotnet_diagnostic.IDE0032.severity = suggestion
84102

103+
# IDE0036: Order modifiers
104+
dotnet_diagnostic.IDE0036.severity = warning
105+
106+
# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)
107+
dotnet_diagnostic.IDE0038.severity = warning
108+
85109
# IDE0040: Add accessibility modifiers
86110
dotnet_diagnostic.IDE0040.severity = warning
87111

112+
# IDE0041 Use 'is null' check
113+
dotnet_diagnostic.IDE0041.severity = suggestion
114+
88115
# IDE0042: Deconstruct variable declaration
89116
dotnet_diagnostic.IDE0042.severity = suggestion
90117

@@ -100,15 +127,24 @@ dotnet_diagnostic.IDE0046.severity = suggestion
100127
# IDE0047: Remove unnecessary parentheses
101128
dotnet_diagnostic.IDE0047.severity = suggestion
102129

130+
# IDE0048
131+
dotnet_diagnostic.IDE0048.severity = suggestion
132+
103133
# IDE0049: Simplify Names
104134
dotnet_diagnostic.IDE0049.severity = suggestion
105135

106136
# IDE0034: Simplify 'default' expression
107137
dotnet_diagnostic.IDE0034.severity = suggestion
108138

139+
# IDE0054: Use compound assignment
140+
dotnet_diagnostic.IDE0054.severity = suggestion
141+
109142
# IDE0055: Formatting rule
110143
dotnet_diagnostic.IDE0055.severity = warning
111144

145+
# IDE0056: Use index operator
146+
dotnet_diagnostic.IDE0056.severity = suggestion
147+
112148
# IDE0057: Substring can be simplified
113149
dotnet_diagnostic.IDE0057.severity = suggestion
114150

@@ -124,6 +160,9 @@ dotnet_diagnostic.IDE0060.severity = warning
124160
# IDE0063: Use simple 'using' statement
125161
dotnet_diagnostic.IDE0063.severity = suggestion
126162

163+
# IDE0066: Use switch expression
164+
dotnet_diagnostic.IDE0066.severity = suggestion
165+
127166
# IDE0071: Simplify interpolation
128167
dotnet_diagnostic.IDE0071.severity = suggestion
129168

@@ -139,9 +178,21 @@ dotnet_diagnostic.IDE0083.severity = suggestion
139178
# IDE0090: Use 'new(...)'
140179
dotnet_diagnostic.IDE0090.severity = suggestion
141180

181+
# IDE0100: Remove unnecessary equality operator
182+
dotnet_diagnostic.IDE0100.severity = warning
183+
184+
# IDE0120: Simplify LINQ expression
185+
dotnet_diagnostic.IDE0120.severity = warning
186+
187+
# IDE0270: Null check can be simplified (if null check)
188+
dotnet_diagnostic.IDE0270.severity = suggestion
189+
142190
# IDE1005: Delegate invocation can be simplified.
143191
dotnet_diagnostic.IDE1005.severity = suggestion
144192

193+
# IDE1006: Code-style naming rules
194+
dotnet_diagnostic.IDE1006.severity = warning
195+
145196
# IDE0160: Convert to block scoped namespace
146197
dotnet_diagnostic.IDE0160.severity = none
147198

@@ -765,3 +816,14 @@ dotnet_diagnostic.CA5403.severity = error
765816

766817
# Analyzer version mismatch
767818
dotnet_diagnostic.CA9999.severity = error
819+
820+
dotnet_naming_style.underscored_camel_case.capitalization = camel_case
821+
dotnet_naming_style.underscored_camel_case.required_prefix = _
822+
823+
# Rule to force private fields to be underscored camel case
824+
dotnet_naming_symbols.private_fields.applicable_kinds = field
825+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
826+
827+
dotnet_naming_rule.private_fields_underscored.symbols = private_fields
828+
dotnet_naming_rule.private_fields_underscored.style = underscored_camel_case
829+
dotnet_naming_rule.private_fields_underscored.severity = suggestion

0 commit comments

Comments
 (0)