Skip to content

Commit 9a3d384

Browse files
committed
Preserve line break
1 parent 13e3fe2 commit 9a3d384

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/formatter/formatPropValue.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe('formatPropValue', () => {
6868
showFunctions: true,
6969
})
7070
).toBe('{function Myfunction() {}}');
71+
7172
expect(
7273
formatPropValue(doThings, false, 0, {
7374
functionValue,
@@ -80,6 +81,7 @@ describe('formatPropValue', () => {
8081
expect(formatPropValue(<div />, false, 0, {})).toBe(
8182
'{<MockedFormatTreeNodeResult />}'
8283
);
84+
8385
expect(parseReactElement).toHaveBeenCalledTimes(1);
8486
expect(formatTreeNode).toHaveBeenCalledTimes(1);
8587
});

src/formatter/formatReactFragmentNode.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const toReactElementTreeNode = (
1515
childrens: TreeNode[]
1616
): ReactElementTreeNode => {
1717
let props = {};
18-
1918
if (key) {
2019
props = {
2120
key,
@@ -32,7 +31,6 @@ const toReactElementTreeNode = (
3231
};
3332

3433
const isKeyedFragment = ({ key }: ReactFragmentTreeNode) => Boolean(key);
35-
3634
const hasNoChildren = ({ childrens }: ReactFragmentTreeNode) =>
3735
childrens.length === 0;
3836

@@ -53,7 +51,6 @@ export default (
5351
const { useFragmentShortSyntax } = options;
5452

5553
let displayName;
56-
5754
if (useFragmentShortSyntax) {
5855
if (hasNoChildren(node) || isKeyedFragment(node)) {
5956
displayName = REACT_FRAGMENT_TAG_NAME_EXPLICIT_SYNTAX;

0 commit comments

Comments
 (0)