Skip to content

eslint/default-case Restriction

What it does

Require default cases in switch statements

Why is this bad?

Some code conventions require that all switch statements have a default case, even if the default case is empty.

Example

javascript
switch (foo) {
  case 1:
    break;
}

References

Released under the MIT License.