mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
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:
parent
abd9610530
commit
e1c51f3c0d
8 changed files with 72 additions and 12 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue