1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00

fix: adding a check to .mjs, and .mts files and skip the suggestions if one of them detected

This commit is contained in:
MohammadSu1 2024-11-03 09:06:49 +02:00
parent be969cb532
commit de4a115da7

View file

@ -303,6 +303,13 @@ fn format_js_error_inner(
}
fn get_suggestions_for_terminal_errors(e: &JsError) -> Vec<FixSuggestion> {
if let Some(frame) = e.frames.get(0) {
if let Some(file_name) = &frame.file_name {
if file_name.ends_with(".mjs") || file_name.ends_with(".mts") {
return vec![];
}
}
}
if let Some(msg) = &e.message {
if msg.contains("module is not defined")
|| msg.contains("exports is not defined")