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:
parent
be969cb532
commit
de4a115da7
1 changed files with 7 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue