diff --git a/crates/oxc_cli/fixtures/astro/debugger.astro b/crates/oxc_cli/fixtures/astro/debugger.astro
index 3c1754963..94a674706 100644
--- a/crates/oxc_cli/fixtures/astro/debugger.astro
+++ b/crates/oxc_cli/fixtures/astro/debugger.astro
@@ -1,3 +1,20 @@
---
debugger
---
+
+
+
+
+
+
+
+
+
+
+
diff --git a/crates/oxc_cli/src/lint/mod.rs b/crates/oxc_cli/src/lint/mod.rs
index 0a7df1914..f76f89a20 100644
--- a/crates/oxc_cli/src/lint/mod.rs
+++ b/crates/oxc_cli/src/lint/mod.rs
@@ -370,7 +370,7 @@ mod test {
let args = &["fixtures/astro/debugger.astro"];
let result = test(args);
assert_eq!(result.number_of_files, 1);
- assert_eq!(result.number_of_warnings, 1);
+ assert_eq!(result.number_of_warnings, 4);
assert_eq!(result.number_of_errors, 0);
}
}
diff --git a/crates/oxc_linter/src/partial_loader/astro_partial_loader.rs b/crates/oxc_linter/src/partial_loader/astro_partial_loader.rs
index c5a1005c4..bed6b1030 100644
--- a/crates/oxc_linter/src/partial_loader/astro_partial_loader.rs
+++ b/crates/oxc_linter/src/partial_loader/astro_partial_loader.rs
@@ -1,9 +1,13 @@
-use memchr::memmem;
+use memchr::memmem::Finder;
use oxc_span::{SourceType, Span};
use super::JavaScriptSource;
+const ASTRO_SPLIT: &str = "---";
+const SCRIPT_START: &str = ""
+ if let Some(offset) = script_end_finder.find(self.source_text[pointer..].as_bytes()) {
+ js_end = pointer + offset;
+ pointer += offset + SCRIPT_END.len();
+ } else {
+ break;
+ };
+ results.push(JavaScriptSource::new(
+ &self.source_text[js_start..js_end],
+ SourceType::default().with_typescript(true).with_module(true),
+ ));
+ }
+ results
+ }
}