@putout/printer 18.38.0 → 18.38.1

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.07.16, v18.38.1
2
+
3
+ fix:
4
+ - d0db3655 @putout/printer: jsx: CallExpression
5
+
1
6
  2026.07.15, v18.38.0
2
7
 
3
8
  feature:
@@ -17,11 +17,15 @@ const condition = createTypeChecker([
17
17
  const {
18
18
  isJSXElement,
19
19
  isArrowFunctionExpression,
20
- isCallExpression,
21
20
  } = types;
22
21
 
23
22
  const isInsideArrow = ({parentPath}) => isArrowFunctionExpression(parentPath);
24
23
 
24
+ const isInsideCallWithOneArg = createTypeChecker([
25
+ ['-: parentPath -> !CallExpression'],
26
+ ['+: parentPath.node.arguments.length', '=', 1],
27
+ ]);
28
+
25
29
  export const JSXElement = {
26
30
  condition,
27
31
  before(path, {write, indent, maybe}) {
@@ -37,9 +41,8 @@ export const JSXElement = {
37
41
  }
38
42
  },
39
43
  print(path, {print, traverse, maybe}) {
40
- const {parentPath} = path;
41
44
  const needIndent = isNeedIndent(path);
42
- const parentCall = isCallExpression(parentPath);
45
+ const parentCall = isInsideCallWithOneArg(path);
43
46
 
44
47
  maybe.indent.inc(needIndent);
45
48
  maybe.print.breakline(parentCall);
@@ -66,4 +69,3 @@ export const JSXElement = {
66
69
  maybe.write(!leadingComments?.length, ')');
67
70
  },
68
71
  };
69
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.38.0",
3
+ "version": "18.38.1",
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",