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

challenge(formatter): quit hard line break if default clause has no consequent #768

Merged
merged 2 commits into from Nov 18, 2023

Conversation

unvalley
Copy link
Member

@unvalley unvalley commented Nov 18, 2023

Summary

This PR will suppress comment hard line breaks in the default clause of switch and reduce diffs with prettier.

But this pr does not fix test cases perfectly, skip below one. I'm investigating, but we can separate the PR.

// FIXME
// TODO: reformat issue
// switch(5){default: // comment5
// // comment5a
// foo();bar();//comment5b
// break;// comment5c
// }

Test Plan

cargo test -p biome_js_formatter --test prettier_tests

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Nov 18, 2023
@ematipico ematipico changed the title challnge(formatter): quit hard line break if default clause has no consequent challenge(formatter): quit hard line break if default clause has no consequent Nov 18, 2023
@unvalley unvalley merged commit 0149819 into biomejs:main Nov 18, 2023
12 checks passed
@unvalley unvalley deleted the fix-js-switch-comment2 branch November 18, 2023 12:10
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.

None yet

2 participants