diff options
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index b9908f413..f8577ed1b 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -206,6 +206,8 @@ pub struct FmtFlags { pub no_semicolons: Option<bool>, pub watch: Option<WatchFlags>, pub unstable_css: bool, + pub unstable_html: bool, + pub unstable_component: bool, pub unstable_yaml: bool, } @@ -2104,7 +2106,8 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .default_value("ts") .value_parser([ "ts", "tsx", "js", "jsx", "md", "json", "jsonc", "css", "scss", - "sass", "less", "yml", "yaml", "ipynb", + "sass", "less", "html", "svelte", "vue", "astro", "yml", "yaml", + "ipynb", ]), ) .arg( @@ -2189,6 +2192,20 @@ Ignore formatting a file by adding an ignore comment at the top of the file: .action(ArgAction::SetTrue), ) .arg( + Arg::new("unstable-html") + .long("unstable-html") + .help("Enable formatting HTML files.") + .value_parser(FalseyValueParser::new()) + .action(ArgAction::SetTrue), + ) + .arg( + Arg::new("unstable-component") + .long("unstable-component") + .help("Enable formatting Svelte, Vue, Astro and Angular files.") + .value_parser(FalseyValueParser::new()) + .action(ArgAction::SetTrue), + ) + .arg( Arg::new("unstable-yaml") .long("unstable-yaml") .help("Enable formatting YAML files.") @@ -4058,6 +4075,8 @@ fn fmt_parse(flags: &mut Flags, matches: &mut ArgMatches) { let prose_wrap = matches.remove_one::<String>("prose-wrap"); let no_semicolons = matches.remove_one::<bool>("no-semicolons"); let unstable_css = matches.get_flag("unstable-css"); + let unstable_html = matches.get_flag("unstable-html"); + let unstable_component = matches.get_flag("unstable-component"); let unstable_yaml = matches.get_flag("unstable-yaml"); flags.subcommand = DenoSubcommand::Fmt(FmtFlags { @@ -4071,6 +4090,8 @@ fn fmt_parse(flags: &mut Flags, matches: &mut ArgMatches) { no_semicolons, watch: watch_arg_parse(matches), unstable_css, + unstable_html, + unstable_component, unstable_yaml, }); } @@ -5891,6 +5912,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Default::default(), }), @@ -5916,6 +5939,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Default::default(), }), @@ -5941,6 +5966,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Default::default(), }), @@ -5966,6 +5993,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Some(Default::default()), }), @@ -5980,6 +6009,8 @@ mod tests { "--watch", "--no-clear-screen", "--unstable-css", + "--unstable-html", + "--unstable-component", "--unstable-yaml" ]); assert_eq!( @@ -5998,6 +6029,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: true, + unstable_html: true, + unstable_component: true, unstable_yaml: true, watch: Some(WatchFlags { hmr: false, @@ -6034,6 +6067,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Some(Default::default()), }), @@ -6059,6 +6094,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Default::default(), }), @@ -6092,6 +6129,8 @@ mod tests { prose_wrap: None, no_semicolons: None, unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Some(Default::default()), }), @@ -6130,6 +6169,8 @@ mod tests { prose_wrap: Some("never".to_string()), no_semicolons: Some(true), unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Default::default(), }), @@ -6162,6 +6203,8 @@ mod tests { prose_wrap: None, no_semicolons: Some(false), unstable_css: false, + unstable_html: false, + unstable_component: false, unstable_yaml: false, watch: Default::default(), }), |