Files
test-repo/changelog_unreleased/javascript/14192.md
T

23 lines
681 B
Markdown

#### Avoid unnecessarily indenting nested `await` expressions (#14192 by @thorn0)
A refinement of [this change in v2.3](https://prettier.io/blog/2021/05/09/2.3.0.html#improve-formatting-for-nested-await-expressions-in-heads-of-member-and-call-expressions-10342httpsgithubcomprettierprettierpull10342-by-thorn0httpsgithubcomthorn0). Sometimes there is no need to force indentation of nested `await` expressions.
<!-- prettier-ignore -->
```jsx
// Prettier stable
await Promise.all(
(
await readdir("src")
).map((path) => {
import(`./${path}`);
})
);
// Prettier main
await Promise.all(
(await readdir("src")).map((path) => {
import(`./${path}`);
}),
);
```