@putout/printer 5.37.0 → 5.38.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
+ 2023.10.25, v5.38.0
2
+
3
+ feature:
4
+ - 983412b comments: leading: improve
5
+
1
6
  2023.10.24, v5.37.0
2
7
 
3
8
  feature:
@@ -66,7 +66,6 @@ module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics)
66
66
  const looksLikeDirective = path.isDirective();
67
67
  const looksLikeProp = path.isObjectProperty();
68
68
 
69
- // || path.isTSPropertySignature();
70
69
  if (looksLikeProp)
71
70
  print.breakline();
72
71
 
@@ -1,7 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  const {isDecorator} = require('@putout/babel').types;
4
- const {isLast, isCoupleLines} = require('../is');
4
+ const {
5
+ isLast,
6
+ isCoupleLines,
7
+ isNext,
8
+ } = require('../is');
5
9
 
6
10
  const hasBody = (path) => path.node.body;
7
11
 
@@ -30,7 +34,7 @@ module.exports.parseTrailingComments = (path, {write, maybe}, semantics) => {
30
34
 
31
35
  if (hasBody(path)) {
32
36
  write.breakline();
33
- write.breakline();
37
+ maybe.write.breakline(!isNext(path));
34
38
  }
35
39
 
36
40
  write(`//${value}`);
@@ -34,6 +34,7 @@ const {
34
34
  maybeParenOpen,
35
35
  maybeParenClose,
36
36
  } = require('../expressions/unary-expression/parens');
37
+
37
38
  const {maybePrintTypeAnnotation} = require('../maybe/maybe-type-annotation');
38
39
 
39
40
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "5.37.0",
3
+ "version": "5.38.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",