@putout/printer 18.6.3 → 18.6.4

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
@@ -1,7 +1,13 @@
1
+ 2026.03.14, v18.6.4
2
+
3
+ feature:
4
+ - ccfe6be @putout/printer: VariableDeclaration: afterIf: simplify
5
+ - 70a6c99 @putout/printer: VariableDeclration: afterIf: simplify
6
+
1
7
  2026.03.14, v18.6.3
2
8
 
3
9
  feature:
4
- - 5837376 @putout/printer: VariableDeclration: afterIf:
10
+ - 5837376 @putout/printer: VariableDeclration: afterIf: simplify
5
11
 
6
12
  2026.03.13, v18.6.2
7
13
 
@@ -7,6 +7,7 @@ import {isSpaceAfterComma} from './space.js';
7
7
  export const ObjectProperty = (path, printer, semantics) => {
8
8
  const {trailingComma} = semantics;
9
9
  const {shorthand} = path.node;
10
+
10
11
  const {
11
12
  maybe,
12
13
  traverse,
@@ -23,6 +23,14 @@ const {
23
23
  isVariableDeclaration,
24
24
  } = types;
25
25
 
26
+ const notLastPrevVarNotNextVar = createTypeChecker([
27
+ ['-: -> !', callWithPrev(exists)],
28
+ ['-', isTwoLinesDifferenceWithPrev],
29
+ ['-', isLast],
30
+ ['-: -> !', callWithPrev(isVariableDeclaration)],
31
+ ['+: -> !', callWithNext(isVariableDeclaration)],
32
+ ]);
33
+
26
34
  const isNoPrevAndNextConst = createTypeChecker([
27
35
  ['-: ->', callWithPrev(exists)],
28
36
  ['+', callWithNext(isVariableDeclaration)],
@@ -71,15 +79,3 @@ export const afterIf = createTypeChecker([
71
79
  ['+: parentPath -> TSModuleBlock'],
72
80
  ]);
73
81
 
74
- function notLastPrevVarNotNextVar(path) {
75
- const prev = path.getPrevSibling();
76
- const next = path.getNextSibling();
77
-
78
- if (!exists(prev.getPrevSibling()))
79
- return false;
80
-
81
- if (path.node.loc?.start.line === prev.node?.loc?.start.line + 2)
82
- return false;
83
-
84
- return !isLast(path) && prev.isVariableDeclaration() && !next.isVariableDeclaration();
85
- }
@@ -23,6 +23,7 @@ export const report = (coverage) => {
23
23
  for (const index of difference(fullSet(length), covered)) {
24
24
  const currentType = typeNames[index];
25
25
  const rawCode = createRawCode(currentType);
26
+
26
27
  const code = codeFrameColumns(rawCode, {}, {
27
28
  forceColor: true,
28
29
  });
@@ -8,6 +8,7 @@ const noop = () => {};
8
8
  export const TSTypeParameterDeclaration = (path, printer, semantics) => {
9
9
  const {print, indent} = printer;
10
10
  const isNewline = hasComplexParameters(path);
11
+
11
12
  const printSpace = createPrintSpace({
12
13
  isNewline,
13
14
  printer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.6.3",
3
+ "version": "18.6.4",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",