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

fmt: use --write option of prettier/main.ts (#2363)

This is step 1 of the plan outlined here:
https://github.com/denoland/deno/issues/2090#issuecomment-492897028
This commit is contained in:
Yoshiya Hinosawa 2019-05-16 23:11:35 +09:00 committed by Ryan Dahl
parent e02d8bcf18
commit 6a5893a269

View file

@ -448,6 +448,9 @@ pub fn flags_from_vec(
.collect();
argv.extend(files);
// `deno fmt` writes to the files by default
argv.push("--write".to_string());
DenoSubcommand::Run
}
("info", Some(info_match)) => {
@ -726,7 +729,13 @@ mod tests {
assert_eq!(subcommand, DenoSubcommand::Run);
assert_eq!(
argv,
svec!["deno", PRETTIER_URL, "script_1.ts", "script_2.ts"]
svec![
"deno",
PRETTIER_URL,
"script_1.ts",
"script_2.ts",
"--write"
]
);
}