summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/integration/fmt_tests.rs4
-rw-r--r--cli/tools/fmt.rs7
2 files changed, 9 insertions, 2 deletions
diff --git a/cli/tests/integration/fmt_tests.rs b/cli/tests/integration/fmt_tests.rs
index f38160a15..18ad2ab29 100644
--- a/cli/tests/integration/fmt_tests.rs
+++ b/cli/tests/integration/fmt_tests.rs
@@ -185,8 +185,8 @@ itest!(fmt_stdin {
itest!(fmt_stdin_markdown {
args: "fmt --ext=md -",
- input: Some("# Hello Markdown\n```ts\nconsole.log( \"text\")\n```\n"),
- output_str: Some("# Hello Markdown\n\n```ts\nconsole.log(\"text\");\n```\n"),
+ input: Some("# Hello Markdown\n```ts\nconsole.log( \"text\")\n```\n\n```cts\nconsole.log( 5 )\n```"),
+ output_str: Some("# Hello Markdown\n\n```ts\nconsole.log(\"text\");\n```\n\n```cts\nconsole.log(5);\n```\n"),
});
itest!(fmt_stdin_json {
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs
index 475767331..3eb620900 100644
--- a/cli/tools/fmt.rs
+++ b/cli/tools/fmt.rs
@@ -194,6 +194,10 @@ fn format_markdown(
| "tsx"
| "js"
| "jsx"
+ | "cjs"
+ | "cts"
+ | "mjs"
+ | "mts"
| "javascript"
| "typescript"
| "json"
@@ -707,7 +711,10 @@ fn is_supported_ext_fmt(path: &Path) -> bool {
| "tsx"
| "js"
| "jsx"
+ | "cjs"
+ | "cts"
| "mjs"
+ | "mts"
| "json"
| "jsonc"
| "md"