Skip to content

Commit

Permalink
fix: Remove indent_style field in LayoutConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Aug 26, 2024
1 parent ba6c074 commit c4729bd
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub fn format(input: &str, _filename: &str, config: Option<Config>) -> Result<St
#[wasm_bindgen(typescript_custom_section)]
const TS_Config: &'static str = r#"
interface LayoutConfig {
indent_style?: "tab" | "space";
indent_width?: number;
line_width?: number;
line_ending?: "lf" | "crlf";
Expand All @@ -51,8 +50,6 @@ extern "C" {

#[derive(Deserialize, Clone, Default)]
pub struct LayoutConfig {
#[serde(alias = "indentStyle")]
indent_style: Option<IndentStyle>,
#[serde(alias = "indentWidth")]
indent_width: Option<usize>,
#[serde(alias = "lineWidth")]
Expand All @@ -61,15 +58,6 @@ pub struct LayoutConfig {
line_ending: Option<LineEnding>,
}

#[derive(Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Default)]
enum IndentStyle {
Tab,
#[default]
Space,
}

#[derive(Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Default)]
Expand All @@ -87,10 +75,6 @@ impl From<LayoutConfig> for config::LayoutOptions {
layout.print_width = line_width;
}

if let Some(indent_style) = value.indent_style {
layout.use_tabs = matches!(indent_style, IndentStyle::Tab);
}

if let Some(indent_width) = value.indent_width {
layout.indent_width = indent_width;
}
Expand Down

0 comments on commit c4729bd

Please sign in to comment.