Files
test-repo/changelog_unreleased/javascript/pr-8419.md
T
Georgii Dolzhykov 5a0e33cc84 fix(range): improve detection of JS source elements (#8419)
* fix(range): improve detection of JS source elements

* Add changelog entry

* Remove unneeded comment

* Add more types and update snapshots
2020-05-29 07:29:09 +03:00

562 B

Improve detection of source elements for range formatting (#8419 by @thorn0)

Not all statement types were detected (read here how range formatting works in Prettier).

// Input
for   (const  element of list) { /* ... */ }
//     ^^^^^^^^^^^^^^^^^^^^^^ ← range

// Prettier stable
for   (const  element of list) { /* ... */ }

// Prettier master
for (const element of list) {
  /* ... */
}