@putout/printer 18.12.0 → 18.13.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,11 @@
1
+ 2026.05.22, v18.13.0
2
+
3
+ feature:
4
+ - 26783f0b @putout/printer: ArrayExpression: newline: strings and object
5
+ - e6d930c3 @putout/printer: supertape v13.2.0
6
+ - 15bd1f83 @putout/printer: montag v2.0.1
7
+ - 6a74d29a @putout/printer: @putout/plugin-promises v20.0.0
8
+
1
9
  2026.04.15, v18.12.0
2
10
 
3
11
  feature:
@@ -39,7 +39,6 @@ export const ArrayExpression = {
39
39
  } = semantics;
40
40
 
41
41
  const needIndent = isNeedIndent(path);
42
-
43
42
  const multiline = isMultiLine(path, {
44
43
  maxElementsInOneLine,
45
44
  maxElementLengthInOneLine,
@@ -1,6 +1,25 @@
1
+ import {types} from '@putout/babel';
2
+
3
+ const {
4
+ isStringLiteral,
5
+ isObjectExpression,
6
+ } = types;
7
+
1
8
  export const isMultilineOption = (a, {multiline}) => multiline;
2
9
  export const isNeedsToHideIndentOption = (a, {needsToHideIndent}) => needsToHideIndent;
3
10
  export const isLastOption = (a, {isLast}) => isLast;
4
11
 
5
12
  export const isTrailingCommaOption = (a, {trailingComma}) => trailingComma;
6
13
  export const isNeedsIndentBeforeElementOption = (a, {needsIndentBeforeElement}) => needsIndentBeforeElement;
14
+
15
+ export const isStringsAndObject = (path) => {
16
+ const elements = path.get('elements');
17
+
18
+ if (!isObjectExpression(elements.at(-1)))
19
+ return false;
20
+
21
+ const strings = elements.filter(isStringLiteral);
22
+
23
+ return strings.length === elements.length - 1;
24
+ };
25
+
@@ -13,7 +13,10 @@ import {
13
13
  isInsideArray,
14
14
  } from '#is';
15
15
  import {isIncreaseIndent} from './indent.js';
16
- import {isMultilineOption} from './is.js';
16
+ import {
17
+ isMultilineOption,
18
+ isStringsAndObject,
19
+ } from './is.js';
17
20
 
18
21
  const {
19
22
  isObjectExpression,
@@ -253,6 +256,7 @@ const isMixedTuples = (path, {maxElementLengthInOneLine}) => {
253
256
 
254
257
  export const isMultiLine = createTypeChecker([
255
258
  ['-: node.elements.length -> -'],
259
+ ['-', isStringsAndObject],
256
260
  ['-', isTupleInsideArray],
257
261
  ['+', isMixedTuples],
258
262
  ['+', isBodyWithOneElement],
@@ -351,3 +355,4 @@ export const isIndentBeforeElement = createTypeChecker([
351
355
  ['+: -> SpreadElement'],
352
356
  ['+: -> !ObjectExpression'],
353
357
  ]);
358
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.12.0",
3
+ "version": "18.13.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",
@@ -81,7 +81,7 @@
81
81
  "@putout/eslint-flat": "^4.0.0",
82
82
  "@putout/plugin-minify": "^12.0.0",
83
83
  "@putout/plugin-printer": "^8.0.0",
84
- "@putout/plugin-promises": "^19.0.0",
84
+ "@putout/plugin-promises": "^20.0.0",
85
85
  "@putout/plugin-react-hook-form": "^6.0.0",
86
86
  "@putout/plugin-react-hooks": "^9.0.0",
87
87
  "@supertape/operator-strip": "^1.0.0",
@@ -95,13 +95,13 @@
95
95
  "goldstein": "^7.0.0",
96
96
  "just-kebab-case": "^4.2.0",
97
97
  "madrun": "^13.0.0",
98
- "montag": "^1.0.0",
98
+ "montag": "^2.0.1",
99
99
  "nodemon": "^3.0.1",
100
100
  "putout": "^42.0.1",
101
101
  "redlint": "^6.0.0",
102
102
  "samadhi": "^4.0.2",
103
103
  "superc8": "^12.2.4",
104
- "supertape": "^12.0.9",
104
+ "supertape": "^13.2.0",
105
105
  "try-catch": "^4.0.6",
106
106
  "typescript": "^6.0.2"
107
107
  },