@putout/printer 18.0.11 → 18.0.12

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,3 +1,8 @@
1
+ 2026.03.05, v18.0.12
2
+
3
+ fix:
4
+ - 9766539 @putout/printer: ArrayExpression: newline
5
+
1
6
  2026.03.05, v18.0.11
2
7
 
3
8
  feature:
@@ -61,23 +61,18 @@ const isSiblingIsArray = (path) => {
61
61
 
62
62
  const isEmptyArray = (path) => !path.node.elements.length;
63
63
 
64
- const isAllLiterals = (path) => {
65
- const {elements} = path.node;
66
- const literals = elements.filter(isStringLiteral);
67
-
68
- return literals.length !== elements.length;
69
- };
70
-
71
64
  const isMoreThenMaxLiteralLength = (path, {maxElementLengthInOneLine}) => {
72
65
  const [first] = path.node.elements;
73
66
 
67
+ if (!first.value)
68
+ return false;
69
+
74
70
  return first.value.length > maxElementLengthInOneLine;
75
71
  };
76
72
 
77
73
  const isMoreThenMaxElementLengthInOneLine = createTypeChecker([
78
74
  ['-', isEmptyArray],
79
75
  ['-: -> !', isInsideCall],
80
- ['-', isAllLiterals],
81
76
  ['+', isMoreThenMaxLiteralLength],
82
77
  ]);
83
78
 
@@ -18,7 +18,11 @@ const isInsideExportDefaultWithBody = createTypeChecker([
18
18
  ['+', hasFnBody],
19
19
  ]);
20
20
 
21
- const isInsideBlockLike = createTypeChecker(['+: parentPath.parentPath -> TSModuleBlock', '-: parentPath -> !BlockStatement', ['+: -> !', hasFnBody]]);
21
+ const isInsideBlockLike = createTypeChecker([
22
+ '+: parentPath.parentPath -> TSModuleBlock',
23
+ '-: parentPath -> !BlockStatement',
24
+ ['+: -> !', hasFnBody],
25
+ ]);
22
26
 
23
27
  const not = (fn) => (...a) => !fn(...a);
24
28
  const notInsideExportDefaultWithBody = not(isInsideExportDefaultWithBody);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.0.11",
3
+ "version": "18.0.12",
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",