@putout/printer 14.7.2 → 14.7.3

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
+ 2025.05.23, v14.7.3
2
+
3
+ feature:
4
+ - f32d6cd ReturnStatement: inside LabeledStatement
5
+
1
6
  2025.05.03, v14.7.2
2
7
 
3
8
  feature:
@@ -144,4 +144,3 @@ module.exports.ImportDeclaration.printTrailingCommentBlock = (path, printer, sem
144
144
  maybe.print.breakline(!isExportDeclaration(next));
145
145
  printComment();
146
146
  };
147
-
@@ -2,6 +2,7 @@
2
2
 
3
3
  const {types} = require('@putout/babel');
4
4
 
5
+ const {isInsideLabel} = require('#is');
5
6
  const {
6
7
  isPrevBody,
7
8
  noTrailingComment,
@@ -10,6 +11,7 @@ const {
10
11
 
11
12
  const {hasPrevNewline} = require('../../mark');
12
13
  const {maybeSpaceAfterKeyword} = require('./maybe-space-after-keyword');
14
+
13
15
  const {isJSXElement} = types;
14
16
  const isBodyLength = ({parentPath}) => parentPath.node?.body?.length > 2;
15
17
 
@@ -23,9 +25,9 @@ module.exports.ReturnStatement = {
23
25
  print.linebreak();
24
26
  },
25
27
  print(path, printer, semantics) {
26
- const {indent, print} = printer;
28
+ const {maybe, print} = printer;
27
29
 
28
- indent();
30
+ maybe.indent(!isInsideLabel(path));
29
31
  print('return');
30
32
  maybeSpaceAfterKeyword(path, printer, semantics);
31
33
 
@@ -67,3 +69,4 @@ function isJSXWithComment(path) {
67
69
 
68
70
  return isJSXElement(arg) && leadingComments?.length;
69
71
  }
72
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "14.7.2",
3
+ "version": "14.7.3",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",