Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/rules/no-conditional-statement.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow conditional statements (no-conditional-statement)

This rule disallows conditional statements such as if and switch.
This rule disallows conditional statements such as `if` and `switch`.

## Rule Details

Expand Down Expand Up @@ -68,7 +68,7 @@ const defaults = {

#### `true`

The optional allows conditional statements but only if all defined branches end with a return statement or other terminal.
Allows conditional statements but only if all defined branches end with a return statement or other terminal.
This allows early escapes to be used.

```js
Expand All @@ -83,8 +83,8 @@ function foo(error, data) {

#### `"ifExhaustive"`

This will only allow conditional statements to exists if every case is taken it to account and each has a return statement or other terminal.
In other works, every if must have an else and every switch must have a default case.
This will only allow conditional statements to exist if every case is taken into account and each has a return statement or other terminal.
In other words, every `if` must have an `else` and every `switch` must have a default case.
This allows conditional statements to be used like [do expressions](https://github.com/tc39/proposal-do-expressions).

```js
Expand Down