Skip to content

Commit ef71410

Browse files
committed
fix(linter): use jsx if source type is JS in fix debug assertion (#15434)
1 parent 3166233 commit ef71410

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

crates/oxc_linter/src/service/runtime.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,14 @@ impl Runtime {
602602
}
603603

604604
if me.linter.options().fix.is_some() {
605-
let fix_result =
606-
Fixer::new(dep.source_text, messages, SourceType::from_path(path).ok())
607-
.fix();
605+
let fix_result = Fixer::new(
606+
dep.source_text,
607+
messages,
608+
SourceType::from_path(path)
609+
.ok()
610+
.map(|st| if st.is_javascript() { st.with_jsx(true) } else { st }),
611+
)
612+
.fix();
608613
if fix_result.fixed {
609614
// write to file, replacing only the changed part
610615
let start = 0;

0 commit comments

Comments
 (0)