Skip to content

feat(migrate): map ESLint spacing rules to delimiterSpacing#9724

Merged
ematipico merged 4 commits intobiomejs:nextfrom
luisherranz:feat/delimiter-spacing-eslint
Apr 24, 2026
Merged

feat(migrate): map ESLint spacing rules to delimiterSpacing#9724
ematipico merged 4 commits intobiomejs:nextfrom
luisherranz:feat/delimiter-spacing-eslint

Conversation

@luisherranz
Copy link
Copy Markdown

Summary

Maps ESLint spacing rules to the new delimiterSpacing formatter option in the migration tool, building on #9718 (core).

Updates FormatterOption("delimiterSpacing") for the following rules across eslint, @stylistic, react, and vue plugins:

  • array-bracket-spacing
  • computed-property-spacing
  • space-in-brackets
  • space-in-parens
  • template-curly-spacing
  • jsx-curly-spacing

Depends on: #9718 (core). Since this PR is from a fork, the base is set to next. The diff will include core commits until core is merged.

AI usage

AI assisted in identifying the relevant ESLint rules and updating the migration mappings.

Test Plan

  • Existing migration tests pass

Add the `delimiterSpacing` formatter option. This option inserts spaces
inside delimiters when content fits on a single line. Empty delimiters
are not affected, and no space is added before the opening delimiter.
The specific delimiters affected depend on the language.

Includes the shared DelimiterSpacing type, global configuration,
overrides support, Prettier migration, CLI flag, generated
schema/bindings, and changeset.
Update ESLint migration mappings to reference the new delimiterSpacing
formatter option for: array-bracket-spacing, computed-property-spacing,
space-in-brackets, space-in-parens, template-curly-spacing,
jsx-curly-spacing (across eslint, @Stylistic, react, and vue plugins).
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 30, 2026

⚠️ No Changeset found

Latest commit: 369204a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project A-Formatter Area: formatter labels Mar 30, 2026
@luisherranz luisherranz marked this pull request as ready for review April 1, 2026 09:11
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f26beff6-ddeb-46e5-ba8e-6a2192d3be22

📥 Commits

Reviewing files that changed from the base of the PR and between e64d636 and 369204a.

📒 Files selected for processing (1)
  • crates/biome_cli/src/execute/migrate/unsupported_rules.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_cli/src/execute/migrate/unsupported_rules.rs

Walkthrough

This change updates the UNSUPPORTED_RULES constant in the Biome CLI migration module, remapping several ESLint spacing-related rules from generic categories (FormatterCovers/Stylistic) to the FormatterOption("delimiterSpacing") reason. The affected rules include array-bracket-spacing, computed-property-spacing, space-in-brackets, space-in-parens, template-curly-spacing, and jsx-curly-spacing across ESLint, ESLint React, ESLint Stylistic, and ESLint VueJS rule sources. The array structure and unmodified entries remain intact.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: mapping ESLint spacing rules to the new delimiterSpacing formatter option.
Description check ✅ Passed The description clearly explains the purpose of the PR, lists the specific rules being updated, and references the dependency on #9718.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_service/src/settings.rs (1)

583-600: ⚠️ Potential issue | 🟠 Major

Wire delimiter_spacing into override application.

OverrideFormatSettings stores the value and to_override_settings preserves it, but OverrideSettingPattern::apply_overrides_to_js_format_options, OverrideSettingPattern::apply_overrides_to_json_format_options, and OverrideSettingPattern::apply_overrides_to_css_format_options never read it. Right now overrides[].formatter.delimiterSpacing is dutifully stored, then politely ignored. Please thread it through the relevant helpers and add a regression test.

Also applies to: 1920-1935

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_service/src/settings.rs` around lines 583 - 600,
OverrideFormatSettings currently stores delimiter_spacing but the override
application helpers ignore it; update
OverrideSettingPattern::apply_overrides_to_js_format_options,
::apply_overrides_to_json_format_options, and
::apply_overrides_to_css_format_options to read the
OverrideFormatSettings.delimiter_spacing and set the corresponding delimiter
spacing field in the target format options (the same place other fields like
bracket_spacing and bracket_same_line are applied), ensure to pull the value
from the OverrideFormatSettings passed through to_override_settings flow, and
add a regression test that sets overrides[].formatter.delimiterSpacing and
asserts the resulting JS/JSON/CSS format options reflect that value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/delimiter-spacing-eslint.md:
- Around line 1-3: The changeset currently marks the release as "patch" for
"@biomejs/biome" but should be "minor" because it adds new migration behaviour;
update the changeset entry that reads `"@biomejs/biome": patch` to
`"@biomejs/biome": minor` (ensure the YAML header in the changeset file is
edited accordingly so the change type is minor).

---

Outside diff comments:
In `@crates/biome_service/src/settings.rs`:
- Around line 583-600: OverrideFormatSettings currently stores delimiter_spacing
but the override application helpers ignore it; update
OverrideSettingPattern::apply_overrides_to_js_format_options,
::apply_overrides_to_json_format_options, and
::apply_overrides_to_css_format_options to read the
OverrideFormatSettings.delimiter_spacing and set the corresponding delimiter
spacing field in the target format options (the same place other fields like
bracket_spacing and bracket_same_line are applied), ensure to pull the value
from the OverrideFormatSettings passed through to_override_settings flow, and
add a regression test that sets overrides[].formatter.delimiterSpacing and
asserts the resulting JS/JSON/CSS format options reflect that value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1d019adb-32ad-4b57-b8c7-9e85e422a06c

📥 Commits

Reviewing files that changed from the base of the PR and between 9ee64f8 and e64d636.

⛔ Files ignored due to path filters (7)
  • crates/biome_cli/tests/snapshots/main_cases_help/check_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_help/ci_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_help/format_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_configuration/tests/invalid/formatter_extraneous_field.json.snap is excluded by !**/*.snap and included by **
  • crates/biome_configuration/tests/invalid/formatter_quote_style.json.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (8)
  • .changeset/delimiter-spacing-eslint.md
  • .changeset/delimiter-spacing-option.md
  • crates/biome_cli/src/execute/migrate/prettier.rs
  • crates/biome_cli/src/execute/migrate/unsupported_rules.rs
  • crates/biome_configuration/src/formatter.rs
  • crates/biome_configuration/src/overrides.rs
  • crates/biome_formatter/src/lib.rs
  • crates/biome_service/src/settings.rs

Comment thread .changeset/delimiter-spacing-eslint.md Outdated
Comment thread crates/biome_configuration/src/formatter.rs
@ematipico ematipico added this to the Biome v2.5 milestone Apr 19, 2026
@github-actions github-actions Bot removed A-Project Area: project A-Formatter Area: formatter labels Apr 24, 2026
@ematipico ematipico merged commit 8047bc5 into biomejs:next Apr 24, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants