@putout/printer 1.133.1 → 1.134.0
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
CHANGED
|
@@ -9,6 +9,7 @@ const {
|
|
|
9
9
|
isIdentifier,
|
|
10
10
|
isCallExpression,
|
|
11
11
|
isBooleanLiteral,
|
|
12
|
+
isNullLiteral,
|
|
12
13
|
isObjectExpression,
|
|
13
14
|
} = require('@babel/types');
|
|
14
15
|
|
|
@@ -27,6 +28,7 @@ const isIdentifierAndIdentifier = ([a, b]) => isIdentifier(a) && isIdentifier(b)
|
|
|
27
28
|
const isInsideArray = (path) => path.parentPath.isArrayExpression();
|
|
28
29
|
const isSimpleAndCall = ([a, b]) => isSimple(a) && isCallExpression(b);
|
|
29
30
|
const isBooleanAndSimple = ([a, b]) => isBooleanLiteral(a) && isSimple(b);
|
|
31
|
+
const isNullAndSimple = ([a, b]) => isNullLiteral(a) && isSimple(b);
|
|
30
32
|
|
|
31
33
|
const isTwoLongStrings = ([a, b]) => {
|
|
32
34
|
const LONG_STRING = 20;
|
|
@@ -236,6 +238,9 @@ function isNewlineBetweenElements(path, {elements}) {
|
|
|
236
238
|
if (isBooleanAndSimple(elements))
|
|
237
239
|
return false;
|
|
238
240
|
|
|
241
|
+
if (isNullAndSimple(elements))
|
|
242
|
+
return false;
|
|
243
|
+
|
|
239
244
|
if (isSimpleAndCall(elements))
|
|
240
245
|
return false;
|
|
241
246
|
|
package/package.json
CHANGED