@putout/printer 17.7.2 → 17.8.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,13 @@
1
+ 2026.02.22, v17.8.0
2
+
3
+ feature:
4
+ - e4edea2 @putout/printer: comments: improve support
5
+
6
+ 2026.02.18, v17.7.3
7
+
8
+ feature:
9
+ - 40c01d1 @putout/printer: rendy v5.0.0
10
+
1
11
  2026.02.17, v17.7.2
2
12
 
3
13
  feature:
package/lib/printer.d.ts CHANGED
@@ -60,6 +60,4 @@ interface Options {
60
60
  export function print(ast: types.Node, options?: Options): string;
61
61
 
62
62
  declare function maybeVisitor(plugin: Visitor, path: types.Path, printer: Print, semantics: Semantics): void;
63
-
64
63
  export const visitors = Visitors;
65
-
@@ -1,5 +1,7 @@
1
1
  import {isNext} from '#is';
2
2
 
3
+ const isEmptyBody = ({node}) => !node.body.length;
4
+
3
5
  export const parseComments = (path, {write, maybe}, semantics) => {
4
6
  if (!semantics.comments)
5
7
  return;
@@ -18,7 +20,7 @@ export const parseComments = (path, {write, maybe}, semantics) => {
18
20
  write('//');
19
21
  write(value);
20
22
 
21
- if (program) {
23
+ if (program && isEmptyBody(path)) {
22
24
  maybe.write.newline(i < n);
23
25
  continue;
24
26
  }
@@ -1,4 +1,4 @@
1
- import rendy from 'rendy';
1
+ import {rendy} from 'rendy';
2
2
  import {types} from '@putout/babel';
3
3
  import maybeSatisfy from './satisfy.js';
4
4
 
@@ -7,7 +7,7 @@ import {
7
7
  printTrailingCommentLine,
8
8
  } from './import-declaration-comments.js';
9
9
 
10
- export {ImportAttribute} from './import-attribute.js';
10
+ export {ImportAttribute} from '#import-attributes';
11
11
 
12
12
  export const ImportDeclaration = {
13
13
  print(path, printer, semantics) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "17.7.2",
3
+ "version": "17.8.0",
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",
@@ -40,7 +40,7 @@
40
40
  "fullstore": "^4.0.0",
41
41
  "just-snake-case": "^3.2.0",
42
42
  "parse-import-specifiers": "^1.0.1",
43
- "rendy": "^4.0.0"
43
+ "rendy": "^5.0.0"
44
44
  },
45
45
  "keywords": [
46
46
  "putout",