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(js_formatter): correctly format dangling comments of continue statement #2555

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

ah-yu
Copy link
Contributor

@ah-yu ah-yu commented Apr 22, 2024

Summary

// input
for (const f of fs) {
    if (condition) continue; //commment
    else continue; // comment
}

// before
for (const f of fs) {
  if (condition)
    continue;
      //commment
  else continue; // comment
}
// above code will be reformatted as 
for (const f of fs) {
  if (condition) continue;
  //commment
  else continue; // comment
}


// after
for (const f of fs) {
  if (condition)
    continue; // commment
  else continue; // comment
}

Test Plan

Add new test cases

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Apr 22, 2024
@github-actions github-actions bot added the A-Changelog Area: changelog label Apr 22, 2024
Copy link

codspeed-hq bot commented Apr 22, 2024

CodSpeed Performance Report

Merging #2555 will not alter performance

Comparing ah-yu:refmt_issue_15168 (e799f04) with main (250ded1)

Summary

✅ 93 untouched benchmarks

@ah-yu ah-yu merged commit f3afb52 into biomejs:main Apr 22, 2024
12 checks passed
@ah-yu ah-yu deleted the refmt_issue_15168 branch April 22, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants