no-null
Added in v0.9.1Configuration
rslint.config.ts
Rule Details
Disallow the null literal and encourage using undefined as the single value
for missing data.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Strict equality comparisons are ignored by default:
Options
This rule accepts an object with two boolean options:
checkArguments(default:true) checksnullwhen it is a direct function call or constructor argument. Set it tofalsewhen APIs requirenullarguments.checkStrictEquality(default:false) checks strict equality and inequality comparisons againstnull.
The rule follows Unicorn's built-in exceptions for Object.create(null),
useRef(null), React.useRef(null), and null as the second argument of a
two-argument insertBefore call.