---
source: crates/oxc_linter/src/tester.rs
expression: switch_case_braces
---
  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(something) { case 1: {} case 2: {console.log('something'); break;}}
   ·                             ──
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(something) { case 1: case 2: console.log('something'); break;}
   ·                                     ────────────────────────────────
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { case 1: {} case 2: {} default: { doSomething(); } }
   ·                       ──
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { case 1: {} case 2: {} default: { doSomething(); } }
   ·                                  ──
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { case 1: { /* fallthrough */ } default: {}/* fallthrough */ case 3: { doSomething(); break; } }
   ·                       ─────────────────────
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { case 1: { /* fallthrough */ } default: {}/* fallthrough */ case 3: { doSomething(); break; } }
   ·                                                      ──
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { default: doSomething(); }
   ·                        ──────────────
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { case 1: { doSomething(); } break; /* <-- This should be between braces */ }
   ·                       ─────────────────────────
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(foo) { default: label: {} }
   ·                        ─────────
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.

  ⚠ eslint-plugin-unicorn(switch-case-braces):  Empty switch case shouldn't have braces and not-empty case should have braces around it.
   ╭─[switch_case_braces.tsx:1:1]
 1 │ switch(something) { case 1: case 2: { console.log('something'); break; } case 3: console.log('something else'); }
   ·                                                                                  ──────────────────────────────
   ╰────
  help: There is less visual clutter for empty cases and proper scope for non-empty cases.


