Repository: biomejs/biome (language: rust)

Issue:
🐛 Panic `internal error: entered unreachable code: Missing switch clause`
### Environment information

```block
CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0
```


### What happened?

```
timeout -v 150 biome lint TEST___FILE.ts
```
crashes with
```
Source Location: crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs:157:33
Thread Name: biome::worker_1
Message: internal error: entered unreachable code: Missing switch clause.
```

File - [compressed.zip](https://github.com/user-attachments/files/17796893/compressed.zip)


### Expected result

No crash

### Code of Conduct

- [X] I agree to follow Biome's Code of Conduct


Discussion / hints:

Fix patch:
diff --git a/.changeset/fix_no_fallthrough_switch_case_panic.md b/.changeset/fix_no_fallthrough_switch_case_panic.md
new file mode 100644
index 000000000000..f1d33eed3d08
--- /dev/null
+++ b/.changeset/fix_no_fallthrough_switch_case_panic.md
@@ -0,0 +1,5 @@
+---
+cli: patch
+---
+
+# The rule `noFallthroughSwitchCase` no longer panics on some incomplete code snippets.
diff --git a/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs b/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs
index eb7cd306390b..9fc87d4bde46 100644
--- a/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs
+++ b/crates/biome_js_analyze/src/lint/suspicious/no_fallthrough_switch_clause.rs
@@ -156,7 +156,7 @@ impl Rule for NoFallthroughSwitchClause {
                         if is_switch && (conditional || has_default_clause) {
                             // Take the unconditional jump into account only if a default clause is present.
                             let Some(switch_clause) = switch_clauses.pop_front() else {
-                                unreachable!("Missing switch clause.")
+                                break;
                             };
                             block_to_switch_clause_range.insert(
                                 jump_block_id,


Test patch:
diff --git a/crates/biome_js_analyze/tests/specs/suspicious/noFallthroughSwitchClause/issue4566.js b/crates/biome_js_analyze/tests/specs/suspicious/noFallthroughSwitchClause/issue4566.js
new file mode 100644
index 000000000000..258fe68e8c2d
--- /dev/null
+++ b/crates/biome_js_analyze/tests/specs/suspicious/noFallthroughSwitchClause/issue4566.js
@@ -0,0 +1,2 @@
+ switch(r case ""switch":
+case t"
\ No newline at end of file
diff --git a/crates/biome_js_analyze/tests/specs/suspicious/noFallthroughSwitchClause/issue4566.js.snap b/crates/biome_js_analyze/tests/specs/suspicious/noFallthroughSwitchClause/issue4566.js.snap
new file mode 100644
index 000000000000..3e11197c4222
--- /dev/null
+++ b/crates/biome_js_analyze/tests/specs/suspicious/noFallthroughSwitchClause/issue4566.js.snap
@@ -0,0 +1,9 @@
+---
+source: crates/biome_js_analyze/tests/spec_tests.rs
+expression: issue4566.js
+---
+# Input
+```js
+ switch(r case ""switch":
+case t"
+```