summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2021-01-19 23:09:35 +0530
committerGitHub <noreply@github.com>2021-01-19 18:39:35 +0100
commit16036a8a5170030a95a56b28b29b1b355d0d0f80 (patch)
tree87d6e5dfe13662270df61a5221efe814b4b1f40f /cli/main.rs
parent4c223d0521bf9711ccd4813a04ba7b1f7899485b (diff)
feat: add markdown support to deno fmt (#8887)
This commit adds support for formatting markdown files with "deno fmt". Additionally "--ext={js|jsx|ts|tsx|md}" flag was added to "deno fmt" that allows to specify file type when providing contents over stdio.
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/main.rs b/cli/main.rs
index de0e63e84..d98313f54 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -807,9 +807,10 @@ async fn format_command(
args: Vec<PathBuf>,
ignore: Vec<PathBuf>,
check: bool,
+ ext: String,
) -> Result<(), AnyError> {
if args.len() == 1 && args[0].to_string_lossy() == "-" {
- return tools::fmt::format_stdin(check);
+ return tools::fmt::format_stdin(check, ext);
}
tools::fmt::format(args, ignore, check, flags.watch).await?;
@@ -1179,7 +1180,8 @@ fn get_subcommand(
check,
files,
ignore,
- } => format_command(flags, files, ignore, check).boxed_local(),
+ ext,
+ } => format_command(flags, files, ignore, check, ext).boxed_local(),
DenoSubcommand::Info { file, json } => {
info_command(flags, file, json).boxed_local()
}