We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6f0d28 commit ce5095aCopy full SHA for ce5095a
crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs
@@ -25,12 +25,18 @@ pub struct PreferToBeTruthy;
25
declare_oxc_lint!(
26
/// ### What it does
27
///
28
+ /// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. With `--fix`, it will be replaced with `toBeTruthy`.
29
- /// ### Why is this bad?
30
+ /// ### Examples
31
- ///
32
- /// ### Example
33
/// ```javascript
+ /// // bad
34
+ /// expect(foo).toBe(true)
35
+ /// expectTypeOf(foo).toBe(true)
36
+ ///
37
+ /// // good
38
+ /// expect(foo).toBeTruthy()
39
+ /// expectTypeOf(foo).toBeTruthy()
40
/// ```
41
PreferToBeTruthy,
42
style,
0 commit comments