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.
This commit is contained in:
Bartek Iwańczuk 2023-01-24 21:07:00 +01:00 committed by GitHub
parent abd9610530
commit e1c51f3c0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 72 additions and 12 deletions

View file

@ -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)]