diff options
author | Pig Fang <g-plane@hotmail.com> | 2024-08-10 00:52:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 18:52:23 +0200 |
commit | 82884348cb1b424a4c4452ef734bc4e760926b2f (patch) | |
tree | a64142bb68dc2509dd9ec421a9a88fcec1e6f65e /cli/args/mod.rs | |
parent | 218ee1b1ffebbb53aa82c8ce55e7ee7061342249 (diff) |
feat(fmt): support CSS, SCSS, Sass and Less (#24870)
This PR integrates [Malva](https://github.com/g-plane/malva) into `deno
fmt`, which introduces the ability to format CSS, SCSS, Sass and Less
files.
On Linux x64 6.10, this PR increases about 800KiB:
```
❯ wc -c target/release/deno
125168728 target/release/deno
❯ wc -c target/release/deno
124349456 target/release/deno
```
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index bd49c0c15..afad0528c 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -281,6 +281,7 @@ impl BenchOptions { #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct UnstableFmtOptions { + pub css: bool, pub yaml: bool, } @@ -314,6 +315,7 @@ impl FmtOptions { Self { options: resolve_fmt_options(fmt_flags, fmt_config.options), unstable: UnstableFmtOptions { + css: unstable.css || fmt_flags.unstable_css, yaml: unstable.yaml || fmt_flags.unstable_yaml, }, files: fmt_config.files, @@ -1330,8 +1332,10 @@ impl CliOptions { } pub fn resolve_config_unstable_fmt_options(&self) -> UnstableFmtOptions { + let workspace = self.workspace(); UnstableFmtOptions { - yaml: self.workspace().has_unstable("fmt-yaml"), + css: workspace.has_unstable("fmt-css"), + yaml: workspace.has_unstable("fmt-yaml"), } } @@ -1664,6 +1668,7 @@ impl CliOptions { "sloppy-imports", "byonm", "bare-node-builtins", + "fmt-css", "fmt-yaml", ]); // add more unstable flags to the same vector holding granular flags |