@putout/printer 18.9.3 → 18.10.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
@@ -1,3 +1,8 @@
1
+ 2026.04.14, v18.10.0
2
+
3
+ feature:
4
+ - 85c0371d @putout/printer: ArrayExpression: long-lines
5
+
1
6
  2026.04.03, v18.9.3
2
7
 
3
8
  feature:
@@ -148,6 +148,18 @@ const isMoreThenMaxLiteralLength = (path, {maxElementLengthInOneLine}) => {
148
148
  return false;
149
149
  };
150
150
 
151
+ const isTripleMoreThenMaxLiteralLength = (path, {maxElementLengthInOneLine}) => {
152
+ const {elements} = path.node;
153
+ const max = maxElementLengthInOneLine * 3;
154
+
155
+ for (const element of elements.filter(isStringLiteral)) {
156
+ if (element.value.length >= max)
157
+ return true;
158
+ }
159
+
160
+ return false;
161
+ };
162
+
151
163
  const isMoreThenMaxIdentifierLength = (path, {maxElementLengthInOneLine}) => {
152
164
  const [first] = path.node.elements;
153
165
 
@@ -166,6 +178,7 @@ const hasObjects = (path) => {
166
178
 
167
179
  const isMoreThenMaxElementLengthInOneLine = createTypeChecker([
168
180
  ['-: node.elements.length', '<', 2],
181
+ ['+', isTripleMoreThenMaxLiteralLength],
169
182
  ['-: -> !', isInsideCall],
170
183
  ['-', hasObjects],
171
184
  ['+', isMoreThenMaxLiteralLength],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.9.3",
3
+ "version": "18.10.0",
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",