1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-20 20:42:19 -05:00
This commit is contained in:
Mohammad Sulaiman 2025-01-20 16:40:03 +02:00 committed by GitHub
commit 22e9d74c53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 0 deletions

View file

@ -304,6 +304,13 @@ fn format_js_error_inner(
}
fn get_suggestions_for_terminal_errors(e: &JsError) -> Vec<FixSuggestion> {
if let Some(frame) = e.frames.first() {
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")

View file

@ -0,0 +1,4 @@
{
"args": "run --unstable --allow-read main.mts",
"output": "main.out"
}

View file

@ -0,0 +1,6 @@
function add(num1, num2) {
const result = num1 + num2;
return result;
}
module.exports = { add };

View file

@ -0,0 +1,3 @@
import * as a from "./a.cts";
console.log(a.add(1, 2));

View file

@ -0,0 +1 @@
3