Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(formatter): do not break properties of type annotation in function parameters #5174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siketyan
Copy link
Member

Summary

Closes #2406

Prettier seems not breaking properties of a type annotation in function parameters. This pull request adds an exception to formatting object-like nodes to be consistent with Prettier.

Test Plan

Snapshot tests added.

@siketyan siketyan requested review from a team February 22, 2025 03:14
@siketyan siketyan self-assigned this Feb 22, 2025
@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Feb 22, 2025
Copy link

codspeed-hq bot commented Feb 22, 2025

CodSpeed Performance Report

Merging #5174 will not alter performance

Comparing siketyan:fix/GH-2406 (4da4228) with main (177f005)

Summary

✅ 97 untouched benchmarks

"@biomejs/biome": patch
---

Fixed properties of object type annotation in function parameters are expanded, which is inconsistent with Prettier.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
Fixed properties of object type annotation in function parameters are expanded, which is inconsistent with Prettier.
Fixed properties of object type annotation in function parameters are expanded, which was inconsistent with Prettier.

Might be good to also link the fixed issue too.

Copy link
Member

@unvalley unvalley left a comment

Choose a reason for hiding this comment

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

nice fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Biome seems to handle lineWidth differently than Prettier
3 participants