Preserve blank lines between JSX attributes (#19161)
This commit is contained in:
8 files changed
+328
-1
No files matched your search
@@ -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}
|
||||
/>;
|
||||
```
|
||||
Reference in new issue
Block a user