Repository navigation
feat(js-formatter): implement delimiterSpacing for TypeScript - #9721
Conversation
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.
🦋 Changeset detectedLatest commit: 962af08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Implement delimiterSpacing for JSX nodes: expression attribute values, spread attributes, expression children, and spread children.
b4ddcad to
c80b7fe
Compare
Implement delimiterSpacing for TS-specific nodes: type parameters, type arguments, indexed access types, mapped types, tuple types, index signature members, and type assertion expressions.
c80b7fe to
ed61794
Compare
WalkthroughThis PR introduces a new Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 11
🧹 Nitpick comments (4)
crates/biome_js_formatter/src/ts/auxiliary/index_signature_type_member.rs (1)
31-59: Consider usingsoft_block_indent_with_maybe_spaceto reduce duplication.The current if/else branches duplicate most of the formatting logic. You could simplify this using the same pattern as other formatters:
♻️ Suggested simplification
- if delimiter_spacing { - write![ - f, - [ - group(&format_args![ - l_brack_token.format(), - space(), - soft_block_indent(&format_args![parameter.format()]), - space(), - r_brack_token.format(), - ]), - type_annotation.format(), - FormatTypeMemberSeparator::new(separator_token.as_ref()), - ] - ] - } else { - write![ - f, - [ - group(&format_args![ - l_brack_token.format(), - soft_block_indent(&format_args![parameter.format()]), - r_brack_token.format(), - ]), - type_annotation.format(), - FormatTypeMemberSeparator::new(separator_token.as_ref()), - ] - ] - } + write![ + f, + [ + group(&format_args![ + l_brack_token.format(), + soft_block_indent_with_maybe_space(¶meter.format(), delimiter_spacing), + r_brack_token.format(), + ]), + type_annotation.format(), + FormatTypeMemberSeparator::new(separator_token.as_ref()), + ] + ]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_formatter/src/ts/auxiliary/index_signature_type_member.rs` around lines 31 - 59, The two duplicated branches in the formatting block should be collapsed by using soft_block_indent_with_maybe_space instead of conditional insertion of space()—replace the if/else around l_brack_token/parameter/r_brack_token with a single write![] that builds group(&format_args![ l_brack_token.format(), soft_block_indent_with_maybe_space(&format_args![parameter.format()], delimiter_spacing), r_brack_token.format(), ]) followed by type_annotation.format() and FormatTypeMemberSeparator::new(separator_token.as_ref()); this keeps the same tokens (l_brack_token, r_brack_token, parameter.format(), type_annotation.format(), FormatTypeMemberSeparator) but removes the duplicated blocks and relies on soft_block_indent_with_maybe_space to handle optional spacing.crates/biome_js_formatter/src/js/declarations/catch_declaration.rs (1)
40-62: Inconsistent delimiter spacing between branches.The
leading_comment_with_break || trailing_comment_with_breakpath usessoft_block_indentwithout delimiter spacing, whilst the else branch adds explicit spaces. This means:
catch (e)→catch ( e )when delimiter spacing is enabled ✓catch (/* comment */ e)→catch (/* comment */ e)regardless of delimiter spacingIf intentional (e.g., multi-line comments already expand), this is fine—just worth noting for consistency.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_formatter/src/js/declarations/catch_declaration.rs` around lines 40 - 62, The two branches produce inconsistent spacing around delimiters: when leading_comment_with_break || trailing_comment_with_break you use soft_block_indent(...) without honoring should_insert_space_around_delimiters, while the else branch conditionally writes spaces around the inner content; to fix, ensure both paths apply the same delimiter spacing logic by adding conditional space insertion before and after the soft_block_indent call (or alternately remove the explicit spaces in the else branch) so that l_paren_token.format() and r_paren_token.format() behave identically; update the code around l_paren_token.format(), soft_block_indent(&format_args![binding.format(), type_annotation.format()]), r_paren_token.format() to include checks of should_insert_space_around_delimiters and write space() when appropriate.crates/biome_js_formatter/src/ts/types/mapped_type.rs (1)
67-99: Implementation is correct but has some duplication.The conditional branches repeat the formatting for
optional_modifier,mapped_type, andsemicolon_token. Consider extracting these into a shared closure if you're inclined, though it's not critical.♻️ Optional refactor to reduce duplication
if delimiter_spacing { write!( f, [ group(&format_args![ l_brack_token.format(), space(), format_bracket_content, space(), r_brack_token.format(), ]), - optional_modifier.format(), - type_annotation_has_leading_comment.then_some(space()), - mapped_type.format(), - if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref())) ] - ) + )?; } else { write!( f, [ group(&format_args![ l_brack_token.format(), format_bracket_content, r_brack_token.format(), ]), - optional_modifier.format(), - type_annotation_has_leading_comment.then_some(space()), - mapped_type.format(), - if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref())) ] - ) + )?; } + + write!( + f, + [ + optional_modifier.format(), + type_annotation_has_leading_comment.then_some(space()), + mapped_type.format(), + if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref())) + ] + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_formatter/src/ts/types/mapped_type.rs` around lines 67 - 99, The two branches of the delimiter_spacing conditional duplicate the trailing sequence optional_modifier.format(), type_annotation_has_leading_comment.then_some(space()), mapped_type.format(), and if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref())); refactor by extracting that shared sequence into a local closure or variable (e.g., let trailing = || [ optional_modifier.format(), type_annotation_has_leading_comment.then_some(space()), mapped_type.format(), if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref())) ]; ) and then use it in both branches while keeping the differing group(&format_args![ l_brack_token.format(), (space(),)?, format_bracket_content, (space(),)?, r_brack_token.format(), ]) logic controlled by delimiter_spacing; this reduces duplication while preserving existing behavior for l_brack_token, r_brack_token, format_bracket_content and delimiter_spacing.crates/biome_js_formatter/src/jsx/auxiliary/spread_child.rs (1)
55-67: Minor: Hardcodedtrueinstead ofdelimiter_spacingvariable.At line 61, the second argument to
soft_block_indent_with_maybe_spaceis hardcoded astrue. While logically correct (we're inside theif delimiter_spacingbranch), other formatters pass the variable directly for consistency. Consider:- [group(&soft_block_indent_with_maybe_space( - &format_inner, - true - ))] + [group(&soft_block_indent_with_maybe_space( + &format_inner, + delimiter_spacing + ))]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_formatter/src/jsx/auxiliary/spread_child.rs` around lines 55 - 67, The call to soft_block_indent_with_maybe_space currently passes a hardcoded true; change that to pass the delimiter_spacing variable instead so the branch mirrors other formatters and remains consistent—update the invocation inside spread_child.rs where write!(f, [group(&soft_block_indent_with_maybe_space(&format_inner, true))]) is used to pass delimiter_spacing rather than the literal true.
🤖 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-option.md:
- Line 5: Shorten the changeset to 1–3 user-facing sentences that describe the
new formatter.delimiterSpacing option and its behavior; mention that it inserts
spaces inside delimiters on single-line content, does not affect empty
delimiters, defaults to false, and can be set globally via
formatter.delimiterSpacing or per-language via
javascript.formatter.delimiterSpacing, json.formatter.delimiterSpacing, and
css.formatter.delimiterSpacing.
In `@crates/biome_js_formatter/src/js/auxiliary/template_element.rs`:
- Around line 175-199: The current code unconditionally inserts space() tokens
inside the group for `${ ... }` (see should_insert_space,
self.element.dollar_curly_token(), format_indented,
self.element.r_curly_token().format()), causing stray spaces when the group
breaks; replace the fixed space() tokens with a conditional/flat-only spacer
(e.g., soft_line_break_or_space / if_group_break / a flat-only space helper
provided by the formatter) so the space is emitted only in flat mode and omitted
when the group breaks, and update both the opening and closing space usages
inside the group(&format_args![...]) branches accordingly.
In `@crates/biome_js_formatter/src/js/expressions/call_arguments.rs`:
- Around line 541-576: The middle_variant_with_spaces contains explicit space()
padding and is being reused even when grouped_breaks is true (the grouped
argument already broke), causing unwanted delimiter spacing; update the branch
that handles grouped_breaks to prefer middle_variant_without_spaces as the first
fallback instead of middle_variant_with_spaces (and ensure the grouped_breaks
branch does not call or reuse the buffer that inserts space()s), referencing the
variables middle_variant_with_spaces, middle_variant_without_spaces and the
grouped_breaks condition so the no-spaces variant is used when the grouped item
is multiline.
- Around line 74-92: The code currently writes raw leading/trailing spaces based
solely on should_insert_space; instead wrap the args formatting in a formatting
group and emit those spaces only when that group stays flat. Concretely, in the
format_with closure around l_paren_token.format() / args.format_separated(",")
create a group (or use f.group(...) / FormatElement::group) for the joined args
and replace the unconditional write!(f, [space()]) calls with a conditional that
only writes the space when the group is flat (e.g., group.if_flat(...) or
group.is_flat() gating the space emission), keeping should_insert_space as the
outer option check and still use
args.format_separated(",").with_trailing_separator(TrailingSeparator::Omit).
In `@crates/biome_js_formatter/src/js/statements/for_in_statement.rs`:
- Around line 26-49: The code currently emits hard space() when delimiter
spacing is enabled (the guarded should_insert_space checks around the for/in
header), causing spaces even when the header wraps; replace those checks and
space() calls inside format_inner with the formatter's "space only in flat mode"
helper (i.e., the helper that inserts a space only when the group is flat)
instead of unconditional space(), so that spacing between for_token +
l_paren_token and before r_paren_token/FormatStatementBody is emitted only in
flat mode; update usages around format_inner, should_insert_space,
for_token.format(), l_paren_token.format(), and r_paren_token.format()
accordingly.
In `@crates/biome_js_formatter/src/jsx/attribute/spread_attribute.rs`:
- Around line 70-71: The current branch that writes delimiter padding always
emits surrounding spaces even when the inner spread (format_inner) breaks;
update the write! call so the inner expression and its surrounding spaces are
wrapped in a spacing-aware group (instead of emitting raw space(), format_inner,
space()) — e.g. replace write!(f, [space(), format_inner, space()]) with a
single grouped document that contains the leading space, the format_inner, and
the trailing space (using the library’s group/spacing-aware API) so those spaces
collapse automatically when format_inner breaks; reference symbols:
delimiter_spacing, format_inner, and the write!(f, [...]) call in
spread_attribute.rs.
In
`@crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/options.json`:
- Line 2: The $schema path in the JSON climbs one directory too many; update the
"$schema" value by removing a single "../" from the leading relative path so it
climbs one fewer parent directory (i.e., shorten the leading series of "../" by
one) so the path correctly points to
packages/@biomejs/biome/configuration_schema.json.
In `@crates/biome_js_formatter/tests/specs/jsx/delimiter_spacing/options.json`:
- Line 2: The "$schema" value in the JSON fixture is over-traversing by one
"../"; update the "$schema" string so it goes up one fewer directory (remove one
"../") to match the correct path to
packages/@biomejs/biome/configuration_schema.json; locate the "$schema" key in
the file and adjust its path accordingly.
In `@crates/biome_js_formatter/tests/specs/ts/delimiter_spacing/options.json`:
- Line 2: The "$schema" path is too deep by one "../"; update the "$schema"
value so it points to the correct relative location of
packages/@biomejs/biome/configuration_schema.json by removing one "../" from the
existing string (adjust the value assigned to the "$schema" key accordingly) so
editors can resolve the schema.
In `@crates/biome_js_formatter/tests/specs/tsx/delimiter_spacing/options.json`:
- Line 2: The "$schema" value in the JSON spec is using one too many "../"
segments and resolves outside the repo root; update the "$schema" string (the
"$schema" property in
crates/biome_js_formatter/tests/specs/tsx/delimiter_spacing/options.json) to
remove one "../" so it points to
"packages/@biomejs/biome/configuration_schema.json" instead of the current path.
---
Nitpick comments:
In `@crates/biome_js_formatter/src/js/declarations/catch_declaration.rs`:
- Around line 40-62: The two branches produce inconsistent spacing around
delimiters: when leading_comment_with_break || trailing_comment_with_break you
use soft_block_indent(...) without honoring
should_insert_space_around_delimiters, while the else branch conditionally
writes spaces around the inner content; to fix, ensure both paths apply the same
delimiter spacing logic by adding conditional space insertion before and after
the soft_block_indent call (or alternately remove the explicit spaces in the
else branch) so that l_paren_token.format() and r_paren_token.format() behave
identically; update the code around l_paren_token.format(),
soft_block_indent(&format_args![binding.format(), type_annotation.format()]),
r_paren_token.format() to include checks of
should_insert_space_around_delimiters and write space() when appropriate.
In `@crates/biome_js_formatter/src/jsx/auxiliary/spread_child.rs`:
- Around line 55-67: The call to soft_block_indent_with_maybe_space currently
passes a hardcoded true; change that to pass the delimiter_spacing variable
instead so the branch mirrors other formatters and remains consistent—update the
invocation inside spread_child.rs where write!(f,
[group(&soft_block_indent_with_maybe_space(&format_inner, true))]) is used to
pass delimiter_spacing rather than the literal true.
In `@crates/biome_js_formatter/src/ts/auxiliary/index_signature_type_member.rs`:
- Around line 31-59: The two duplicated branches in the formatting block should
be collapsed by using soft_block_indent_with_maybe_space instead of conditional
insertion of space()—replace the if/else around
l_brack_token/parameter/r_brack_token with a single write![] that builds
group(&format_args![ l_brack_token.format(),
soft_block_indent_with_maybe_space(&format_args![parameter.format()],
delimiter_spacing), r_brack_token.format(), ]) followed by
type_annotation.format() and
FormatTypeMemberSeparator::new(separator_token.as_ref()); this keeps the same
tokens (l_brack_token, r_brack_token, parameter.format(),
type_annotation.format(), FormatTypeMemberSeparator) but removes the duplicated
blocks and relies on soft_block_indent_with_maybe_space to handle optional
spacing.
In `@crates/biome_js_formatter/src/ts/types/mapped_type.rs`:
- Around line 67-99: The two branches of the delimiter_spacing conditional
duplicate the trailing sequence optional_modifier.format(),
type_annotation_has_leading_comment.then_some(space()), mapped_type.format(),
and if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref()));
refactor by extracting that shared sequence into a local closure or variable
(e.g., let trailing = || [ optional_modifier.format(),
type_annotation_has_leading_comment.then_some(space()), mapped_type.format(),
if_group_breaks(&FormatOptionalSemicolon::new(semicolon_token.as_ref())) ]; )
and then use it in both branches while keeping the differing
group(&format_args![ l_brack_token.format(), (space(),)?,
format_bracket_content, (space(),)?, r_brack_token.format(), ]) logic controlled
by delimiter_spacing; this reduces duplication while preserving existing
behavior for l_brack_token, r_brack_token, format_bracket_content and
delimiter_spacing.
🪄 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: eb8941c6-84fc-4771-8d5b-0cbba96ae29c
⛔ Files ignored due to path filters (26)
crates/biome_cli/tests/snapshots/main_cases_help/check_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/ci_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/format_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_format/applies_global_delimiter_spacing.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_format/language_overrides_global_delimiter_spacing.snapis excluded by!**/*.snapand included by**crates/biome_configuration/tests/invalid/formatter_extraneous_field.json.snapis excluded by!**/*.snapand included by**crates/biome_configuration/tests/invalid/formatter_quote_style.json.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/arrays.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/arrow_functions.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/call_arguments.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/computed_members.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/conditionals_misc.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/control_flow.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/loops.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/parameters_catch.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/parenthesized.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/setters.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/template_elements.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/unary.js.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/jsx/delimiter_spacing/jsx_expression_attrs.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/jsx/delimiter_spacing/jsx_expression_children.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/ts/delimiter_spacing/type_arguments.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/ts/delimiter_spacing/types.ts.snapis excluded by!**/*.snapand included by**crates/biome_js_formatter/tests/specs/tsx/delimiter_spacing/jsx_expression_attrs.tsx.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (70)
.changeset/delimiter-spacing-js.md.changeset/delimiter-spacing-jsx.md.changeset/delimiter-spacing-option.md.changeset/delimiter-spacing-ts.mdcrates/biome_cli/src/execute/migrate/prettier.rscrates/biome_cli/tests/commands/format.rscrates/biome_configuration/src/formatter.rscrates/biome_configuration/src/javascript/formatter.rscrates/biome_configuration/src/overrides.rscrates/biome_formatter/src/lib.rscrates/biome_js_formatter/src/context.rscrates/biome_js_formatter/src/js/assignments/array_assignment_pattern.rscrates/biome_js_formatter/src/js/auxiliary/template_element.rscrates/biome_js_formatter/src/js/bindings/array_binding_pattern.rscrates/biome_js_formatter/src/js/bindings/parameters.rscrates/biome_js_formatter/src/js/classes/setter_class_member.rscrates/biome_js_formatter/src/js/declarations/catch_declaration.rscrates/biome_js_formatter/src/js/expressions/array_expression.rscrates/biome_js_formatter/src/js/expressions/arrow_function_expression.rscrates/biome_js_formatter/src/js/expressions/call_arguments.rscrates/biome_js_formatter/src/js/expressions/computed_member_expression.rscrates/biome_js_formatter/src/js/expressions/parenthesized_expression.rscrates/biome_js_formatter/src/js/expressions/unary_expression.rscrates/biome_js_formatter/src/js/objects/computed_member_name.rscrates/biome_js_formatter/src/js/objects/setter_object_member.rscrates/biome_js_formatter/src/js/statements/do_while_statement.rscrates/biome_js_formatter/src/js/statements/for_in_statement.rscrates/biome_js_formatter/src/js/statements/for_of_statement.rscrates/biome_js_formatter/src/js/statements/for_statement.rscrates/biome_js_formatter/src/js/statements/if_statement.rscrates/biome_js_formatter/src/js/statements/switch_statement.rscrates/biome_js_formatter/src/js/statements/while_statement.rscrates/biome_js_formatter/src/jsx/attribute/expression_attribute_value.rscrates/biome_js_formatter/src/jsx/attribute/spread_attribute.rscrates/biome_js_formatter/src/jsx/auxiliary/expression_child.rscrates/biome_js_formatter/src/jsx/auxiliary/spread_child.rscrates/biome_js_formatter/src/lib.rscrates/biome_js_formatter/src/ts/assignments/type_assertion_assignment.rscrates/biome_js_formatter/src/ts/auxiliary/index_signature_type_member.rscrates/biome_js_formatter/src/ts/bindings/type_parameters.rscrates/biome_js_formatter/src/ts/classes/index_signature_class_member.rscrates/biome_js_formatter/src/ts/expressions/type_arguments.rscrates/biome_js_formatter/src/ts/expressions/type_assertion_expression.rscrates/biome_js_formatter/src/ts/types/indexed_access_type.rscrates/biome_js_formatter/src/ts/types/mapped_type.rscrates/biome_js_formatter/src/ts/types/tuple_type.rscrates/biome_js_formatter/src/utils/jsx.rscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/arrays.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/arrow_functions.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/call_arguments.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/computed_members.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/conditionals_misc.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/control_flow.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/loops.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/options.jsoncrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/parameters_catch.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/parenthesized.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/setters.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/template_elements.jscrates/biome_js_formatter/tests/specs/js/module/delimiter-spacing/unary.jscrates/biome_js_formatter/tests/specs/jsx/delimiter_spacing/jsx_expression_attrs.jsxcrates/biome_js_formatter/tests/specs/jsx/delimiter_spacing/jsx_expression_children.jsxcrates/biome_js_formatter/tests/specs/jsx/delimiter_spacing/options.jsoncrates/biome_js_formatter/tests/specs/ts/delimiter_spacing/options.jsoncrates/biome_js_formatter/tests/specs/ts/delimiter_spacing/type_arguments.tscrates/biome_js_formatter/tests/specs/ts/delimiter_spacing/types.tscrates/biome_js_formatter/tests/specs/tsx/delimiter_spacing/jsx_expression_attrs.tsxcrates/biome_js_formatter/tests/specs/tsx/delimiter_spacing/options.jsoncrates/biome_service/src/file_handlers/javascript.rscrates/biome_service/src/settings.rs
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Implements
delimiterSpacingfor TypeScript-specific nodes, building on #9720 (JSX).For TypeScript, affects:
< T >)foo< string >())T[ K ]){ [ K in T ]: V })[ string, number ])[ key: string ]: T)< Type >value)AI usage
AI assisted in implementing the TypeScript formatter changes and writing tests.
Test Plan