Preserve blank lines between JSX attributes (#19161)

This commit is contained in:
Igor authored and GitHub committed 2026-06-03 15:40:52 +08:00
1 parent d9e261f836
commit 0a825b05dc
8 files changed
+328 -1

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#### Preserve blank lines between JSX attributes (#19161 by @Poliklot)
Prettier now keeps one existing blank line between JSX attributes, consistent with how it preserves blank lines in many other places. Multiple blank lines are still collapsed to one.
<!-- prettier-ignore -->
```jsx
// Input
<Button
type="submit"
variant="primary"
size="large"
disabled={isSubmitting}
onClick={handleSubmit}
/>;
// Prettier stable
<Button
type="submit"
variant="primary"
size="large"
disabled={isSubmitting}
onClick={handleSubmit}
/>;
// Prettier main
<Button
type="submit"
variant="primary"
size="large"
disabled={isSubmitting}
onClick={handleSubmit}
/>;
```