Skip to content

fix(BREAKING): restore spaceSurroundingExpression spacing around object & array literals and add specific options - #900

Merged
dsherret merged 2 commits into
dprint:mainfrom
thristhart:feat/jsx-expr-container-literal-space
Nov 6, 2026
Merged

dsherret merged 2 commits into
dprint:mainfrom
thristhart:feat/jsx-expr-container-literal-space

Conversation

@thristhart

Copy link
Copy Markdown
Contributor

this option brings back the behavior fixed by #882 (as mentioned in #602)

thristhart and others added 2 commits November 5, 2026 17:55
this option brings back the behavior fixed by dprint#882 (as mentioned in dprint#602)
…eral and spaceSurroundingArrayLiteral

Both default to the value of `jsxExpressionContainer.spaceSurroundingExpression`, which restores the output from before dprint#882. Set them to `false` to keep the brackets beside the braces (ex. `{{ value: true }}`).
@dsherret dsherret changed the title feat: add jsxExpressionContainer.spaceSurroundingObjectOrArrayLiteral feat: add jsxExpressionContainer.spaceSurroundingObjectLiteral and spaceSurroundingArrayLiteral Nov 6, 2026

@dsherret dsherret left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I think it was wrong to switch the old behaviour actually. I just assumed it was a bug, but it was just the one person who complained. I updated this pr to have it as true by default so spaceSurroundingExpression: true is all you'll need and then if someone wants to turn it off they can specify the more specific jsxExpressionContainer.spaceSurroundingObjectLiteral: false and jsxExpressionContainer.spaceSurroundingArrayLiteral: false

@dsherret dsherret changed the title feat: add jsxExpressionContainer.spaceSurroundingObjectLiteral and spaceSurroundingArrayLiteral fix!: restore spaceSurroundingExpression and add jsxExpressionContainer.spaceSurroundingObjectLiteral + spaceSurroundingArrayLiteral Nov 6, 2026
@dsherret dsherret changed the title fix!: restore spaceSurroundingExpression and add jsxExpressionContainer.spaceSurroundingObjectLiteral + spaceSurroundingArrayLiteral fix(BREAKING): restore spaceSurroundingExpression spacing around object & array literals and add specific options Nov 6, 2026
@dsherret
dsherret merged commit 843e100 into dprint:main Nov 6, 2026
1 check passed
@dsherret

dsherret commented Nov 6, 2026

Copy link
Copy Markdown
Member

Kicked off a minor release. Sorry about that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants