# unicorn/switch-case-break-position

> Require `break`, `return`, `continue` and `throw` inside the braces of a `case`

When the body of a `case` is in braces and the `break` comes after the closing brace, the `break` is easy to overlook, and easy to leave behind when you move the block.

The rule reports a `case` that's a block followed by only a `break`, `return`, `continue` or `throw`.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"unicorn/switch-case-break-position" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```js
switch (event.type) {
  case "open": {
    show(event.target);
  }
  break;
}
```

Not reported:

{/* good */}
```js
switch (event.type) {
  case "open": {
    show(event.target);
    break;
  }
  case "close":
    hide(event.target);
    break;
}
```
