prefer-expect-type-of
Added in v0.8.2Configuration
rslint.config.ts
Rule Details
Prefers toBeTypeOf over comparing typeof with a string. The dedicated matcher makes the assertion's intent clearer and gives a better failure message.
The rule supports regular and soft Rstest assertions.
Incorrect
Correct
Autofix
Rewrites the assertion to toBeTypeOf, leaving the expect factory, a message argument, and the modifier chain untouched.