@putout/printer 2.15.0 → 2.17.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
|
@@ -12,7 +12,6 @@ const {
|
|
|
12
12
|
} = require('../../is');
|
|
13
13
|
|
|
14
14
|
const {parseComments} = require('../../comments');
|
|
15
|
-
const {isObjectExpression} = require('@babel/types');
|
|
16
15
|
|
|
17
16
|
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
|
|
18
17
|
const isLogical = (path) => path.get('argument').isLogicalExpression();
|
|
@@ -84,12 +83,8 @@ const notLastArgInsideCall = (path) => {
|
|
|
84
83
|
if (!parentPath.isCallExpression())
|
|
85
84
|
return false;
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
for (const property of properties) {
|
|
90
|
-
if (isObjectExpression(property.value))
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
86
|
+
if (isCoupleLines(path))
|
|
87
|
+
return false;
|
|
93
88
|
|
|
94
89
|
return path !== parentPath
|
|
95
90
|
.get('arguments')
|
package/lib/tokenize/is.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const {markAfter} = require('../../mark');
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
isLast,
|
|
7
|
+
isNext,
|
|
8
|
+
} = require('../../is');
|
|
9
|
+
|
|
5
10
|
const {parseImportSpecifiers} = require('parse-import-specifiers');
|
|
6
11
|
|
|
7
12
|
const {
|
|
@@ -73,7 +78,12 @@ module.exports.ImportDeclaration = {
|
|
|
73
78
|
|
|
74
79
|
if (importsCount > maxSpecifiersInOneLine) {
|
|
75
80
|
maybe.write(n, ',');
|
|
76
|
-
|
|
81
|
+
|
|
82
|
+
const last = index === n;
|
|
83
|
+
const penult = index === n - 1;
|
|
84
|
+
|
|
85
|
+
maybe.write.newline(penult && defaults.length);
|
|
86
|
+
maybe.write.newline(last);
|
|
77
87
|
}
|
|
78
88
|
|
|
79
89
|
indent.dec();
|
package/package.json
CHANGED