diff options
author | Pig Fang <g-plane@hotmail.com> | 2024-08-15 04:58:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-14 22:58:48 +0200 |
commit | 3a3315cc7f3466ce229f6f150402d5ccf72b3d1d (patch) | |
tree | a0299679b2c1eb1cee496905caab380a95f22813 /cli/args/mod.rs | |
parent | 22a834ff5b4b312b8f91be8991f2b495d49fad2f (diff) |
feat(fmt): support HTML, Svelte, Vue, Astro and Angular (#25019)
This commit adds capability to format HTML, Svelte, Vue, Astro and Angular
files.
"--unstable-html" is required to format HTML files, and "--unstable-component"
flag is needed to format other formats. These can also be specified in the config
file.
Close #25015
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 65f9183d5..4a644cb09 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -282,6 +282,8 @@ impl BenchOptions { #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct UnstableFmtOptions { pub css: bool, + pub html: bool, + pub component: bool, pub yaml: bool, } @@ -316,6 +318,8 @@ impl FmtOptions { options: resolve_fmt_options(fmt_flags, fmt_config.options), unstable: UnstableFmtOptions { css: unstable.css || fmt_flags.unstable_css, + html: unstable.html || fmt_flags.unstable_html, + component: unstable.component || fmt_flags.unstable_component, yaml: unstable.yaml || fmt_flags.unstable_yaml, }, files: fmt_config.files, @@ -1339,6 +1343,8 @@ impl CliOptions { let workspace = self.workspace(); UnstableFmtOptions { css: workspace.has_unstable("fmt-css"), + html: workspace.has_unstable("fmt-html"), + component: workspace.has_unstable("fmt-component"), yaml: workspace.has_unstable("fmt-yaml"), } } @@ -1673,6 +1679,8 @@ impl CliOptions { "byonm", "bare-node-builtins", "fmt-css", + "fmt-html", + "fmt-component", "fmt-yaml", ]); // add more unstable flags to the same vector holding granular flags |