diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2019-05-16 23:11:35 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-05-16 10:11:35 -0400 |
commit | 6a5893a26927e3c0329a510f870d2277387aaf30 (patch) | |
tree | 1bf68d51cd93ccec3a5b34d3cf18e7c0ec3cb0b4 /cli | |
parent | e02d8bcf18f8170a41439f4ffa416d26c5846b6e (diff) |
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
Diffstat (limited to 'cli')
-rw-r--r-- | cli/flags.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index fa632513a..171c05ad0 100644 --- a/cli/flags.rs +++ b/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" + ] ); } |