Skip to content

Commit

Permalink
fmt: use --write option of prettier/main.ts (denoland#2363)
Browse files Browse the repository at this point in the history
This is step 1 of the plan outlined here:
denoland#2090 (comment)
  • Loading branch information
kt3k authored and ry committed May 16, 2019
1 parent e02d8bc commit 6a5893a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) => {
Expand Down Expand Up @@ -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"
]
);
}

Expand Down

0 comments on commit 6a5893a

Please sign in to comment.