* add failing test * fix #17489 * add more tests * refactor ...but perhaps get ugly? I'm not sure * Apply automated changes * utilize path.match * add changelog --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
47 lines
1021 B
Markdown
47 lines
1021 B
Markdown
#### Improve consistency for JSX in optional method call (#17616 by @seiyab)
|
|
|
|
<!-- prettier-ignore -->
|
|
```jsx
|
|
// Input
|
|
<SuspendyTree>
|
|
<div style={{ height: 200, overflow: "scroll" }}>
|
|
{Array(20)
|
|
.fill()
|
|
?.map((_, i) => (
|
|
<h2 key={i}>{i + 1}</h2>
|
|
))}
|
|
</div>
|
|
</SuspendyTree>;
|
|
|
|
// Prettier stable (ESTree based parsers like espree and typescript)
|
|
<SuspendyTree>
|
|
<div style={{ height: 200, overflow: "scroll" }}>
|
|
{Array(20)
|
|
.fill()
|
|
?.map((_, i) => <h2 key={i}>{i + 1}</h2>)}
|
|
</div>
|
|
</SuspendyTree>;
|
|
|
|
// Prettier stable (babel and babel-ts parser)
|
|
<SuspendyTree>
|
|
<div style={{ height: 200, overflow: "scroll" }}>
|
|
{Array(20)
|
|
.fill()
|
|
?.map((_, i) => (
|
|
<h2 key={i}>{i + 1}</h2>
|
|
))}
|
|
</div>
|
|
</SuspendyTree>;
|
|
|
|
// Prettier main (parsers of both types)
|
|
<SuspendyTree>
|
|
<div style={{ height: 200, overflow: "scroll" }}>
|
|
{Array(20)
|
|
.fill()
|
|
?.map((_, i) => (
|
|
<h2 key={i}>{i + 1}</h2>
|
|
))}
|
|
</div>
|
|
</SuspendyTree>;
|
|
```
|