Skip to main content

RCS1248: Normalize null check

Properties​

PropertyValue
Default Severitydisabled by default
Minimum language version7.0 (9.0 for 'is not null' syntax)

Examples​

Example #1​

diagnostic.cs
x == null
fix.cs
x is null

Configuration​

info

Option roslynator_null_check_style is required to be set for this analyzer to work.

.editorconfig
# Use equality operator or pattern matching as a null check
roslynator_null_check_style = equality_operator|pattern_matching

Applies to​