Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 Auto-suggestion for js/useBlockStatements can break single-line commented else #3199

Closed
1 task done
lgarron opened this issue Sep 11, 2022 · 1 comment · Fixed by #3276
Closed
1 task done
Assignees
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Milestone

Comments

@lgarron
Copy link

lgarron commented Sep 11, 2022

Environment information

macOS 12.5.1
VSCode v1.71.0
Rome extension v0.14.1

What happened?

Format the following code, using either the VSCode extension or applying fixes from the commandline:

if (true) {
  console.log("true");
} else
  console.log("false"); // comment

This result in broken code:

if (true) {
  console.log("true");
} else {
  console.log("false"); // comment }

Expected result

The added } is on a separate line, instead of being added to (and swallowed by) the comment.

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@lgarron lgarron added the S-To triage Status: user report of a possible bug that needs to be triaged label Sep 11, 2022
lgarron added a commit to cubing/cubing.js that referenced this issue Sep 11, 2022
The line containing `// some irrelevant garbage value` was malformatted.
See rome/tools#3199

After fixing that line, `make format` updated more of the file.
lgarron added a commit to cubing/cubing.js that referenced this issue Sep 11, 2022
The line containing `// some irrelevant garbage value` was malformatted.
See rome/tools#3199

After fixing that line, `make format` updated more of the file.
lgarron added a commit to cubing/cubing.js that referenced this issue Sep 11, 2022
The line containing `// some irrelevant garbage value` was malformatted.
See rome/tools#3199

After fixing that line, `make format` updated more of the file.
@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Sep 12, 2022
@ematipico ematipico added this to the 0.10.0 milestone Sep 12, 2022
@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants