Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 604 Bytes

prefer-to-be-falsy.md

File metadata and controls

26 lines (16 loc) · 604 Bytes

Enforce using toBeFalsy() (vitest/prefer-to-be-falsy)

⚠️ This rule warns in the 🌐 all config.

🔧 This rule is automatically fixable by the --fix CLI option.

Rule Details

This rule aims to enforce the use of toBeFalsy() over toBe(false)

Examples of incorrect code for this rule:

expect(foo).toBe(false)
expectTypeOf(foo).toBe(false)

Examples of correct code for this rule:

expect(foo).toBeFalsy()
expectTypeOf(foo).toBeFalsy()