From 0cbbbe62a9dd4de69ca6ff84952fb318acc3118c Mon Sep 17 00:00:00 2001 From: Naoki Ikeguchi Date: Sun, 16 Feb 2025 18:18:51 +0900 Subject: [PATCH] fix(cli): fix CLI flag of `bracketSpacing` option for lang-specific override (#5130) Signed-off-by: Naoki Ikeguchi Co-authored-by: Arend van Beelen jr. --- .changeset/funny-beans-vanish.md | 5 +++++ .../tests/snapshots/main_commands_check/check_help.snap | 2 ++ .../biome_cli/tests/snapshots/main_commands_ci/ci_help.snap | 2 ++ .../tests/snapshots/main_commands_format/format_help.snap | 4 ++-- crates/biome_configuration/src/javascript/formatter.rs | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/funny-beans-vanish.md diff --git a/.changeset/funny-beans-vanish.md b/.changeset/funny-beans-vanish.md new file mode 100644 index 000000000000..1be39cb4f4b9 --- /dev/null +++ b/.changeset/funny-beans-vanish.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Fixed the flag `--bracket-spacing` that was duplicated between the global configuration and the language-specific override for JavaScript. diff --git a/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap b/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap index e1f3cd366ed4..7ed384687095 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap @@ -70,6 +70,8 @@ The configuration that is contained inside the file `biome.json` code. Defaults to double. --javascript-formatter-attribute-position= The attribute position style in JSX elements. Defaults to auto. + --javascript-formatter-bracket-spacing= Whether to insert spaces around + brackets in object literals. Defaults to true. --javascript-object-wrap= Whether to enforce collapsing object literals when possible. Defaults to preserve. --javascript-linter-enabled= Control the linter for JavaScript (and its super diff --git a/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap b/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap index 4efad215c87f..2b46c945fd1c 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap @@ -71,6 +71,8 @@ The configuration that is contained inside the file `biome.json` code. Defaults to double. --javascript-formatter-attribute-position= The attribute position style in JSX elements. Defaults to auto. + --javascript-formatter-bracket-spacing= Whether to insert spaces around + brackets in object literals. Defaults to true. --javascript-object-wrap= Whether to enforce collapsing object literals when possible. Defaults to preserve. --javascript-linter-enabled= Control the linter for JavaScript (and its super diff --git a/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap b/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap index d4848e7b0ae6..e2d0d872c643 100644 --- a/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap +++ b/crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap @@ -53,8 +53,8 @@ Formatting options specific to the JavaScript files code. Defaults to double. --javascript-formatter-attribute-position= The attribute position style in JSX elements. Defaults to auto. - --bracket-spacing= Whether to insert spaces around brackets in object literals. - Defaults to true. + --javascript-formatter-bracket-spacing= Whether to insert spaces around + brackets in object literals. Defaults to true. --javascript-object-wrap= Whether to enforce collapsing object literals when possible. Defaults to preserve. diff --git a/crates/biome_configuration/src/javascript/formatter.rs b/crates/biome_configuration/src/javascript/formatter.rs index 64a654baee0d..bfc55b5827d6 100644 --- a/crates/biome_configuration/src/javascript/formatter.rs +++ b/crates/biome_configuration/src/javascript/formatter.rs @@ -103,7 +103,7 @@ pub struct JsFormatterConfiguration { // it's also a top-level configurable property. /// Whether to insert spaces around brackets in object literals. Defaults to true. - #[bpaf(long("bracket-spacing"), argument("true|false"))] + #[bpaf(long("javascript-formatter-bracket-spacing"), argument("true|false"))] #[serde(skip_serializing_if = "Option::is_none")] pub bracket_spacing: Option,