pub struct JsonConfig {Show 15 fields
pub locked: Option<bool>,
pub associations: Option<Vec<String>>,
pub array_prefer_single_line: Option<bool>,
pub comment_line_force_space_after_slashes: Option<bool>,
pub deno: Option<bool>,
pub ignore_node_comment_text: Option<String>,
pub indent_width: Option<u32>,
pub json_trailing_comma_files: Option<Vec<String>>,
pub line_width: Option<u32>,
pub new_line_kind: Option<NewLineKind>,
pub object_prefer_single_line: Option<bool>,
pub prefer_single_line: Option<bool>,
pub trailing_commas: Option<TrailingCommas>,
pub use_tabs: Option<bool>,
pub extra: BTreeMap<String, Value>,
}Expand description
Configuration for the dprint JSON plugin.
Fields§
§locked: Option<bool>Whether the configuration is not allowed to be overridden or extended.
associations: Option<Vec<String>>File patterns to associate with this plugin.
array_prefer_single_line: Option<bool>If arrays and objects should collapse to a single line if it would be below the line width.
Default: false
See: https://dprint.dev/plugins/json/config/#arraypreferSingleLine
comment_line_force_space_after_slashes: Option<bool>Forces a space after slashes. For example: // comment instead of //comment
Default: true
See: https://dprint.dev/plugins/json/config/#commentLineforceSpaceAfterSlashes
deno: Option<bool>Top level configuration that sets the configuration to what is used in Deno.
Default: false
ignore_node_comment_text: Option<String>The text to use for an ignore comment (ex. // dprint-ignore).
Default: "dprint-ignore"
See: https://dprint.dev/plugins/json/config/#ignoreNodeCommentText
indent_width: Option<u32>The number of characters for an indent.
Default: 2
json_trailing_comma_files: Option<Vec<String>>When trailingCommas is jsonc, treat these files as JSONC and use trailing commas (ex. ["tsconfig.json", ".vscode/settings.json"]).
See: https://dprint.dev/plugins/json/config/#jsonTrailingCommaFiles
line_width: Option<u32>The width of a line the printer will try to stay under. Note that the printer may exceed this width in certain cases.
Default: 120
new_line_kind: Option<NewLineKind>§object_prefer_single_line: Option<bool>If arrays and objects should collapse to a single line if it would be below the line width.
Default: false
See: https://dprint.dev/plugins/json/config/#objectpreferSingleLine
prefer_single_line: Option<bool>If arrays and objects should collapse to a single line if it would be below the line width.
Default: false
See: https://dprint.dev/plugins/json/config/#preferSingleLine
trailing_commas: Option<TrailingCommas>Whether to use trailing commas.
Default: "jsonc"
use_tabs: Option<bool>Whether to use tabs (true) or spaces (false).
Default: false
extra: BTreeMap<String, Value>Additional plugin-specific settings not covered by the typed fields.
Trait Implementations§
Source§impl Clone for JsonConfig
impl Clone for JsonConfig
Source§fn clone(&self) -> JsonConfig
fn clone(&self) -> JsonConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonConfig
impl Debug for JsonConfig
Source§impl<'de> Deserialize<'de> for JsonConfig
impl<'de> Deserialize<'de> for JsonConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for JsonConfig
impl JsonSchema for JsonConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more