@putout/printer 18.50.1 → 18.50.2

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.11.14, v18.50.2
2
+
3
+ fix:
4
+ - 860f66f9 @putout/printer: CallExpression: multiline concatenation argument
5
+
1
6
  2026.11.14, v18.50.1
2
7
 
3
8
  fix:
@@ -1,7 +1,9 @@
1
- import {types} from '@putout/babel';
1
+ import {createTypeChecker} from '#type-checker';
2
2
 
3
- const {isBinaryExpression} = types;
4
- const isInsideBinary = ({parentPath}) => isBinaryExpression(parentPath);
3
+ const isInsideBinary = createTypeChecker([
4
+ '+: parentPath -> BinaryExpression',
5
+ '+: parentPath -> CallExpression',
6
+ ]);
5
7
 
6
8
  export const maybeInsideBinary = (fn) => (path, printer, semantics) => {
7
9
  const {indent, print} = printer;
@@ -2,6 +2,7 @@ import {types} from '@putout/babel';
2
2
  import {isInsideCall} from '#is';
3
3
  import {maybeParens} from '#maybe-parens';
4
4
  import {createTypeChecker} from '#type-checker';
5
+ import {isConcatenation} from '#is-concatenation';
5
6
 
6
7
  const isLast = (arg) => {
7
8
  const {length} = arg.parentPath.node.arguments;
@@ -46,6 +47,7 @@ const callWithSomeArg = (fn) => (path) => parseArgs(path).some(fn);
46
47
 
47
48
  const isMultiline = createTypeChecker([
48
49
  ['+', callWithSomeArg(isMemberCallee)],
50
+ ['+', callWithSomeArg(isConcatenation)],
49
51
  ['-: -> !', tooLong],
50
52
  ['+', isInsideCall],
51
53
  ]);
@@ -80,6 +82,7 @@ const isBreaklineBeforeArg = createTypeChecker([
80
82
  ['-', isFilledArray],
81
83
  ['+: parentPath', isMaxArgs],
82
84
  ['+', isMemberCallee],
85
+ ['+', isConcatenation],
83
86
  ['-: parentPath -> !', isMultiline],
84
87
  ['+: parentPath.node.arguments.length', '>', 1],
85
88
  ]);
@@ -87,6 +90,7 @@ const isBreaklineBeforeArg = createTypeChecker([
87
90
  const isCommaAfterArg = createTypeChecker([
88
91
  ['+: -> !', isLast],
89
92
  ['+', isMemberCallee],
93
+ ['+', isConcatenation],
90
94
  ['+: parentPath', isMaxArgs],
91
95
  ['-: parentPath.node.arguments.length', '<=', 1],
92
96
  ['+: parentPath', isMultiline],
@@ -94,6 +98,7 @@ const isCommaAfterArg = createTypeChecker([
94
98
 
95
99
  const isBreaklineAfterAllArgs = createTypeChecker([
96
100
  ['+', isMaxArgs],
101
+ ['+', callWithSomeArg(isConcatenation)],
97
102
  ['-: -> !', isMultiline],
98
103
  ['+: node.arguments.length', '>', 1],
99
104
  ['+', getFirstArg(isMemberCallee)],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.50.1",
3
+ "version": "18.50.2",
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",