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