summaryrefslogtreecommitdiff
path: root/cli/args/config_file.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-01-24 21:07:00 +0100
committerGitHub <noreply@github.com>2023-01-24 21:07:00 +0100
commite1c51f3c0d595542fe471359916df2a7b6be5484 (patch)
treecb213509a20a46a208f6623b4012c9f4845bf3c8 /cli/args/config_file.rs
parentabd96105300a7729a4d8eb69af2e81dd6307a163 (diff)
feat(fmt): add ability to configure semicolons (#17292)
Allows to change behavior of `deno fmt` to use "ASI" setting for semicolons instead of always prefering them, this is done by "--options-semi=asi" flag or `"semi": "asi"` setting in the config file.
Diffstat (limited to 'cli/args/config_file.rs')
-rw-r--r--cli/args/config_file.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/args/config_file.rs b/cli/args/config_file.rs
index 2320a0b0d..106a15ddf 100644
--- a/cli/args/config_file.rs
+++ b/cli/args/config_file.rs
@@ -373,6 +373,13 @@ pub enum ProseWrap {
Preserve,
}
+#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
+#[serde(deny_unknown_fields, rename_all = "camelCase")]
+pub enum SemiColons {
+ Prefer,
+ Asi,
+}
+
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
#[serde(default, deny_unknown_fields, rename_all = "camelCase")]
pub struct FmtOptionsConfig {
@@ -381,6 +388,7 @@ pub struct FmtOptionsConfig {
pub indent_width: Option<u8>,
pub single_quote: Option<bool>,
pub prose_wrap: Option<ProseWrap>,
+ pub semi_colons: Option<SemiColons>,
}
#[derive(Clone, Debug, Default, Deserialize)]