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

Compare commits

...

18 commits

Author SHA1 Message Date
Mohammad Sulaiman
ecf3e59113
Merge 8cca53b044 into 9aa02769c8 2025-01-19 20:16:38 +00:00
MohammadSu1
8cca53b044 Adding an output file to the test 2024-11-10 08:54:51 +02:00
MohammadSu1
53d98a358b Merge branch 'cjs_suggestions_for_mjs' of https://github.com/MohammadSu1/my_deno into cjs_suggestions_for_mjs 2024-11-09 18:27:19 +02:00
MohammadSu1
a9b4bba3e4 Upgrade Canary 2024-11-09 18:26:37 +02:00
Mohammad Sulaiman
a4e09ad497
Merge branch 'main' into cjs_suggestions_for_mjs 2024-11-09 18:11:34 +02:00
MohammadSu1
5da2a52ec2 Modify the printing statement to avoid the error 2024-11-09 17:58:20 +02:00
MohammadSu1
52d0cabd9b Modify the output of the test to fit the expected 2024-11-08 20:31:48 +02:00
MohammadSu1
09c3cae9bf Modify the test of .mts and .cts 2024-11-08 20:14:59 +02:00
MohammadSu1
ca469ae97b Fixing th format issues 2024-11-08 19:33:54 +02:00
MohammadSu1
4db134d19e Merge branch 'cjs_suggestions_for_mjs' of https://github.com/MohammadSu1/my_deno into cjs_suggestions_for_mjs 2024-11-08 19:12:29 +02:00
Mohammad Sulaiman
0b6c8bdbe6
Merge branch 'denoland:main' into cjs_suggestions_for_mjs 2024-11-08 19:12:06 +02:00
MohammadSu1
95d7b43e65 Adding a test for the .mts and .cts 2024-11-08 19:11:20 +02:00
Mohammad Sulaiman
63115d2960
Merge branch 'main' into cjs_suggestions_for_mjs 2024-11-05 08:04:03 +02:00
MohammadSu1
29546d8d99 Fixing the PR name 2024-11-03 10:14:36 +02:00
MohammadSu1
b43ccaceaa Merge branch 'cjs_suggestions_for_mjs' of https://github.com/MohammadSu1/my_deno into cjs_suggestions_for_mjs 2024-11-03 09:36:01 +02:00
MohammadSu1
81deb058a0 Solving the issues related to the lint and format 2024-11-03 09:35:49 +02:00
Mohammad Sulaiman
379b477554
Merge branch 'denoland:main' into cjs_suggestions_for_mjs 2024-11-03 09:07:41 +02:00
MohammadSu1
de4a115da7 fix: adding a check to .mjs, and .mts files and skip the suggestions if one of them detected 2024-11-03 09:06:49 +02:00
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