0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 12:16:11 -05:00

Solving the issues related to the lint and format

This commit is contained in:
MohammadSu1 2024-11-03 09:35:49 +02:00
parent de4a115da7
commit 81deb058a0

View file

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