Skip to content

Commit ce5095a

Browse files
committed
docs
1 parent b6f0d28 commit ce5095a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

crates/oxc_linter/src/rules/vitest/prefer_to_be_truthy.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ pub struct PreferToBeTruthy;
2525
declare_oxc_lint!(
2626
/// ### What it does
2727
///
28+
/// This rule warns when `toBe(true)` is used with `expect` or `expectTypeOf`. With `--fix`, it will be replaced with `toBeTruthy`.
2829
///
29-
/// ### Why is this bad?
30+
/// ### Examples
3031
///
31-
///
32-
/// ### Example
3332
/// ```javascript
33+
/// // bad
34+
/// expect(foo).toBe(true)
35+
/// expectTypeOf(foo).toBe(true)
36+
///
37+
/// // good
38+
/// expect(foo).toBeTruthy()
39+
/// expectTypeOf(foo).toBeTruthy()
3440
/// ```
3541
PreferToBeTruthy,
3642
style,

0 commit comments

Comments
 (0)