@putout/printer 14.6.0 → 14.7.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
+ 2025.05.03, v14.7.0
2
+
3
+ feature:
4
+ - 72cc551 @putout/printer: comments: block: trailing
5
+
1
6
  2025.04.29, v14.6.0
2
7
 
3
8
  feature:
@@ -15,6 +15,7 @@ const {
15
15
  isMemberExpression,
16
16
  isExpressionStatement,
17
17
  isCallExpression,
18
+ isImportDeclaration,
18
19
  } = types;
19
20
 
20
21
  const hasBody = (path) => {
@@ -138,7 +139,7 @@ module.exports.parseTrailingComments = (path, {write, maybe, indent}, semantics)
138
139
  if (type === 'CommentBlock') {
139
140
  maybe.write.space(sameLine);
140
141
  maybe.indent(!sameLine);
141
- maybe.print.breakline(isPrevCall(path));
142
+ maybe.print.breakline(isPrevCall(path) || isImportDeclaration(path));
142
143
  write(`/*${value}*/`);
143
144
  maybe.write.newline(!sameLine || !isFnParam(path) && isCoupleLines(path.parentPath));
144
145
  }
@@ -158,3 +159,4 @@ function isPrevCall(path) {
158
159
 
159
160
  return !isCallExpression(expression.arguments[0]);
160
161
  }
162
+
@@ -28,6 +28,7 @@ const {
28
28
  const isFirstStatement = (path) => path.node.body[0];
29
29
  const isFirstDirective = (path) => path.node.directives?.[0];
30
30
  const isMethodOrArrow = (path) => isArrowFunctionExpression(path) || isObjectMethod(path);
31
+
31
32
  const isInsideArrayTupleOfThree = (path) => {
32
33
  const {parentPath} = path.parentPath;
33
34
 
@@ -192,4 +193,3 @@ function isTry({parentPath}) {
192
193
 
193
194
  return parentPath.parentPath?.isTryStatement();
194
195
  }
195
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "14.6.0",
3
+ "version": "14.7.0",
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",