@putout/printer 15.21.0 → 15.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +5 -0
- package/lib/tokenize/jsx/jsx-element.js +8 -4
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -5,6 +5,7 @@ const {
|
|
|
5
5
|
isJSXElement,
|
|
6
6
|
isJSXExpressionContainer,
|
|
7
7
|
isFunction,
|
|
8
|
+
isJSXSpreadAttribute,
|
|
8
9
|
} = types;
|
|
9
10
|
|
|
10
11
|
const isInsideArrow = ({parentPath}) => parentPath.isArrowFunctionExpression();
|
|
@@ -69,10 +70,12 @@ function condition(path) {
|
|
|
69
70
|
function hasComplexAttribute(path) {
|
|
70
71
|
const {attributes} = path.node.openingElement;
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
for (const attribute of attributes) {
|
|
74
|
+
const {value} = attribute;
|
|
75
|
+
|
|
76
|
+
if (isJSXSpreadAttribute(attribute))
|
|
77
|
+
return true;
|
|
78
|
+
|
|
76
79
|
if (!isJSXExpressionContainer(value))
|
|
77
80
|
continue;
|
|
78
81
|
|
|
@@ -95,3 +98,4 @@ function isNeedIndent(path) {
|
|
|
95
98
|
|
|
96
99
|
return insideJSX || insideFn && insideCall;
|
|
97
100
|
}
|
|
101
|
+
|
package/package.json
CHANGED