Skip to content

Commit

Permalink
Add values, additional example (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky authored Oct 8, 2022
1 parent 737cba3 commit cb612d1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/rules/strict-logical-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Examples of **incorrect** code for this rule:

```js
// Potentially falsey strings are not allowed
let str;
let str = '';
<App>{str && <Foo />}</App>;

// Potentially falsey numbers are not allowed
let num;
let num = 0;
<App>{num && <Foo />}</App>;

// Includes types that may be a string or number
Expand All @@ -37,6 +37,10 @@ let str = "Foo";
// Constant values are ok
const str = "Foo";
<App>{str && <Foo />}</App>;

// Constant values are ok
const num = 1;
<App>{num && <Foo />}</App>;
```

### Options
Expand Down

0 comments on commit cb612d1

Please sign in to comment.