diff --git a/crates/oxc_cli/fixtures/vue/debugger.vue b/crates/oxc_cli/fixtures/vue/debugger.vue index 75832eee67682..637ac2bb7ef52 100644 --- a/crates/oxc_cli/fixtures/vue/debugger.vue +++ b/crates/oxc_cli/fixtures/vue/debugger.vue @@ -6,6 +6,6 @@ debugger - diff --git a/crates/oxc_linter/src/partial_loader/vue.rs b/crates/oxc_linter/src/partial_loader/vue.rs index 2405d23b01452..2fb593b226828 100644 --- a/crates/oxc_linter/src/partial_loader/vue.rs +++ b/crates/oxc_linter/src/partial_loader/vue.rs @@ -37,7 +37,7 @@ impl<'a> VuePartialLoader<'a> { *pointer += offset + SCRIPT_START.len(); // find closing ">" - let offset = self.source_text[*pointer..].find('>')?; + let offset = self.find_script_closing_angle(*pointer)?; // get ts and jsx attribute let content = &self.source_text[*pointer..*pointer + offset]; @@ -57,6 +57,27 @@ impl<'a> VuePartialLoader<'a> { SourceType::default().with_module(true).with_typescript(is_ts).with_jsx(is_jsx); Some(JavaScriptSource::new(source_text, source_type, js_start)) } + + /// Find closing angle for situations where there is another `>` in between. + /// e.g. ` "#;