@putout/printer 14.3.3 → 14.3.5
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
|
@@ -80,11 +80,11 @@ module.exports.VariableDeclaration = {
|
|
|
80
80
|
|
|
81
81
|
let wasNewline = false;
|
|
82
82
|
|
|
83
|
-
if (isParentSwitchCase(path)
|
|
84
|
-
write.newline();
|
|
85
|
-
wasNewline = true;
|
|
86
|
-
} else if (isParentSwitchCase(path)) {
|
|
83
|
+
if (isParentSwitchCase(path)) {
|
|
87
84
|
write.newline();
|
|
85
|
+
|
|
86
|
+
if (!isFirstInSwitch(path))
|
|
87
|
+
wasNewline = true;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
if (isParentBlock(path) && isNext(path) && (noTrailingComment(path) || isNewlineBetweenSiblings(path))) {
|
|
@@ -96,6 +96,7 @@ module.exports.VariableDeclaration = {
|
|
|
96
96
|
}),
|
|
97
97
|
afterSatisfy: () => [
|
|
98
98
|
isNextIf,
|
|
99
|
+
isNextFn,
|
|
99
100
|
noNextParentBlock,
|
|
100
101
|
notLastCoupleLines,
|
|
101
102
|
isNextAssign,
|
|
@@ -193,6 +194,11 @@ const isNextIf = (path) => {
|
|
|
193
194
|
return nextPath.isIfStatement();
|
|
194
195
|
};
|
|
195
196
|
|
|
197
|
+
const isNextFn = (path) => {
|
|
198
|
+
const nextPath = path.getNextSibling();
|
|
199
|
+
return nextPath.isFunctionDeclaration();
|
|
200
|
+
};
|
|
201
|
+
|
|
196
202
|
const isNextAssign = (path) => {
|
|
197
203
|
const nextPath = path.getNextSibling();
|
|
198
204
|
|
package/package.json
CHANGED