missing line break after trailing comments of empty statement
Open
Nobody has claimed this yet.
area:comments
lang:javascript
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
Prettier 3.8.1
Playground link
--parser babel-ts
a; /* a */ // b
; /* c */
foo; // first
;// second
;// third
function x() {
} // first
; // second
Output:
a; /* a */ // b
/* c */
foo; // first
// second
// third
function x() {} // first
// second
Expected output:
a; /* a */ // b
/* c */
foo; // first
// second
// third
function x() {} // first
// second
Why?
Should be the same as a non-empty statement to maintain consistency
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/format/js/comments/empty-statements.js at the linked lines and reproduce the Babel TypeScript formatting case from the issue. Compare the current and expected outputs, then add or adjust the regression expectation so empty statements preserve the line break after trailing comments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100