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:
parent
e02d8bcf18
commit
6a5893a269
1 changed files with 10 additions and 1 deletions
11
cli/flags.rs
11
cli/flags.rs
|
@ -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"
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue