Skip to content

Commit

Permalink
docs: Add more examples for multiline-ternary (#17610)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshiotisCy committed Oct 2, 2023
1 parent 47d0b44 commit 1aa26df
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/src/rules/multiline-ternary.md
Expand Up @@ -18,9 +18,14 @@ var foo = bar > baz ? value1 : value2;
The above can be rewritten as the following to improve readability and more clearly delineate the operands:

```js

var foo = bar > baz ?
value1 :
value2;

var foo = bar > baz
? value1
: value2;
```

## Rule Details
Expand Down Expand Up @@ -74,6 +79,12 @@ foo > bar ?
value1 :
value2) :
value3;

foo > bar
? (baz > qux
? value1
: value2)
: value3;
```

:::
Expand Down Expand Up @@ -126,6 +137,12 @@ foo > bar &&
bar > baz ?
value1 :
value2;

foo > bar
? baz > qux
? value1
: value2
: value3;
```

:::
Expand Down

0 comments on commit 1aa26df

Please sign in to comment.