@putout/printer 15.9.0 → 15.9.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,9 @@
1
+ 2025.07.03, v15.9.1
2
+
3
+ feature:
4
+ - 9419ded @putout/printer: hasTrailingCommentsPrinter
5
+ - eb8d16f ExpressionStatement: inside IfStatement
6
+
1
7
  2025.07.03, v15.9.0
2
8
 
3
9
  feature:
@@ -4,15 +4,27 @@ const createPrintCommentLine = (fn, value) => () => fn(`//${value}`);
4
4
  const createPrintCommentBlock = (fn, value) => () => fn(`/*${value}*/\n`);
5
5
 
6
6
  module.exports.hasTrailingCommentsPrinter = (currentTraverse) => {
7
- const {printTrailingCommentBlock} = currentTraverse;
7
+ const {
8
+ printTrailingCommentBlock,
9
+ printTrailingCommentLine,
10
+ } = currentTraverse;
11
+
12
+ if (printTrailingCommentBlock)
13
+ return true;
8
14
 
9
- return Boolean(printTrailingCommentBlock);
15
+ return Boolean(printTrailingCommentLine);
10
16
  };
11
17
 
12
18
  module.exports.hasLeadingCommentsPrinter = (currentTraverse) => {
13
- const {printLeadingCommentLine} = currentTraverse;
19
+ const {
20
+ printLeadingCommentLine,
21
+ printLeadingCommentBlock,
22
+ } = currentTraverse;
14
23
 
15
- return Boolean(printLeadingCommentLine);
24
+ if (printLeadingCommentLine)
25
+ return true;
26
+
27
+ return Boolean(printLeadingCommentBlock);
16
28
  };
17
29
 
18
30
  module.exports.printLeadingComments = (path, printer, semantics, {currentTraverse}) => {
@@ -76,3 +88,4 @@ module.exports.printTrailingComments = (path, printer, semantics, {currentTraver
76
88
  });
77
89
  }
78
90
  };
91
+
@@ -19,7 +19,7 @@ const {isInsideAssignNextAssignFunction} = require('./is-inside-assign-next-assi
19
19
  const {
20
20
  printLeadingCommentLine,
21
21
  printLeadingCommentBlock,
22
- } = require('./comments');
22
+ } = require('./expression-statement-comments');
23
23
 
24
24
  const isCommentBlock = (a) => a?.type === 'CommentBlock';
25
25
 
@@ -13,7 +13,7 @@ const {
13
13
  const {
14
14
  printTrailingCommentBlock,
15
15
  printTrailingCommentLine,
16
- } = require('./comments');
16
+ } = require('./import-declaration-comments');
17
17
 
18
18
  module.exports.ImportAttribute = ImportAttribute;
19
19
  module.exports.ImportDeclaration = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "15.9.0",
3
+ "version": "15.9.1",
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",