@putout/printer 1.131.0 → 1.132.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
|
@@ -8,6 +8,7 @@ const {
|
|
|
8
8
|
isArrayExpression,
|
|
9
9
|
isIdentifier,
|
|
10
10
|
isCallExpression,
|
|
11
|
+
isBooleanLiteral,
|
|
11
12
|
} = require('@babel/types');
|
|
12
13
|
|
|
13
14
|
const {isSimple} = require('@putout/operate');
|
|
@@ -24,6 +25,7 @@ const isStringAndString = ([a, b]) => isStringLiteral(a) && isStringLiteral(b);
|
|
|
24
25
|
const isIdentifierAndIdentifier = ([a, b]) => isIdentifier(a) && isIdentifier(b);
|
|
25
26
|
const isInsideArray = (path) => path.parentPath.isArrayExpression();
|
|
26
27
|
const isSimpleAndCall = ([a, b]) => isSimple(a) && isCallExpression(b);
|
|
28
|
+
const isBooleanAndSimple = ([a, b]) => isBooleanLiteral(a) && isSimple(b);
|
|
27
29
|
|
|
28
30
|
const isTwoLongStrings = ([a, b]) => {
|
|
29
31
|
const LONG_STRING = 20;
|
|
@@ -230,6 +232,9 @@ function isNewlineBetweenElements(path, {elements}) {
|
|
|
230
232
|
if (isInsideLoop(path))
|
|
231
233
|
return false;
|
|
232
234
|
|
|
235
|
+
if (isBooleanAndSimple(elements))
|
|
236
|
+
return false;
|
|
237
|
+
|
|
233
238
|
if (isSimpleAndCall(elements))
|
|
234
239
|
return false;
|
|
235
240
|
|
package/package.json
CHANGED