@putout/printer 18.28.0 → 18.29.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
|
@@ -40,7 +40,23 @@ const isIndent = createTypeChecker([
|
|
|
40
40
|
isNextToAssignmentCall,
|
|
41
41
|
]);
|
|
42
42
|
|
|
43
|
+
function isSameLine(path) {
|
|
44
|
+
const {node} = path;
|
|
45
|
+
const [first] = path.node.trailingComments;
|
|
46
|
+
|
|
47
|
+
if (!node.loc)
|
|
48
|
+
return false;
|
|
49
|
+
|
|
50
|
+
return node.loc.start.line === first.loc.start.line;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const isCommentOnTheSameLine = createTypeChecker([
|
|
54
|
+
['-: -> !', hasTrailingComment],
|
|
55
|
+
['+', isSameLine],
|
|
56
|
+
]);
|
|
57
|
+
|
|
43
58
|
export const isIndentAfter = createTypeChecker([
|
|
59
|
+
['-', isCommentOnTheSameLine],
|
|
44
60
|
['-: node.expression -> !AssignmentExpression'],
|
|
45
61
|
['+', callWithNext(hasLeadingComment)],
|
|
46
62
|
]);
|
|
@@ -81,3 +97,4 @@ export const ExpressionStatement = {
|
|
|
81
97
|
export const isNewlineAfter = createTypeChecker([
|
|
82
98
|
['+: -> !', hasTrailingComment],
|
|
83
99
|
]);
|
|
100
|
+
|
package/package.json
CHANGED