@putout/printer 1.130.1 → 1.131.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 +11 -0
- package/lib/tokenize/expressions/array-expression.js +3 -0
- package/lib/tokenize/statements/export-declaration/export-declaration.js +4 -0
- package/lib/tokenize/statements/import-declaration/import-attribute.js +6 -1
- package/lib/tokenize/statements/variable-declaration/variable-declaration.js +4 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
2023.06.03, v1.131.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 2647101 @putout/printer: ArrayExpression: new line when ObjectExpression
|
|
5
|
+
- 9af0bd8 @putout/printer: ImportAttributes: all cases
|
|
6
|
+
|
|
7
|
+
2023.06.03, v1.130.2
|
|
8
|
+
|
|
9
|
+
feature:
|
|
10
|
+
- 7607ed8 @putout/printer: ExportDeclaration: newline
|
|
11
|
+
|
|
1
12
|
2023.06.03, v1.130.1
|
|
2
13
|
|
|
3
14
|
feature:
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
isNewlineBetweenSiblings,
|
|
5
5
|
exists,
|
|
6
6
|
isNext,
|
|
7
|
+
isLast,
|
|
7
8
|
} = require('../../is');
|
|
8
9
|
|
|
9
10
|
const {
|
|
@@ -107,6 +108,9 @@ module.exports.ExportNamedDeclaration = {
|
|
|
107
108
|
print('__declaration');
|
|
108
109
|
},
|
|
109
110
|
afterIf(path) {
|
|
111
|
+
if (isLast(path))
|
|
112
|
+
return false;
|
|
113
|
+
|
|
110
114
|
if (isDeclarationNewline(path))
|
|
111
115
|
return false;
|
|
112
116
|
|
|
@@ -24,7 +24,12 @@ module.exports.maybePrintAttributes = (path, {write, traverse}) => {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const isAssertions = (path) =>
|
|
27
|
+
const isAssertions = (path) => {
|
|
28
|
+
if (path.node.extra?.deprecatedAssertSyntax)
|
|
29
|
+
return true;
|
|
30
|
+
|
|
31
|
+
return path.node.assertions.length;
|
|
32
|
+
};
|
|
28
33
|
|
|
29
34
|
function printAttributes(path, {write, traverse, type, keyword}) {
|
|
30
35
|
const attributes = path.get(type);
|
|
@@ -70,6 +70,10 @@ module.exports.VariableDeclaration = {
|
|
|
70
70
|
],
|
|
71
71
|
after(path, {maybe, store}) {
|
|
72
72
|
const wasNewline = store();
|
|
73
|
+
|
|
74
|
+
if (isLast(path.parentPath))
|
|
75
|
+
return false;
|
|
76
|
+
|
|
73
77
|
maybe.print.linebreak(wasNewline);
|
|
74
78
|
maybe.print.newline(!wasNewline);
|
|
75
79
|
maybe.markAfter(wasNewline, path);
|
package/package.json
CHANGED