@putout/printer 12.23.1 → 12.24.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,11 @@
1
+ 2025.02.07, v12.24.0
2
+
3
+ fix:
4
+ - d936102 @putout/printer: ExportDefeaultDeclaration: newline
5
+
6
+ feature:
7
+ - d5169a3 @putout/printer: BinaryExpression inside LogicalExpression: comment
8
+
1
9
  2025.02.06, v12.23.1
2
10
 
3
11
  fix:
@@ -18,6 +18,7 @@ const {
18
18
  isTSPropertySignature,
19
19
  isSpreadElement,
20
20
  isClassBody,
21
+ isBinaryExpression,
21
22
  } = types;
22
23
 
23
24
  const isProperty = satisfy([
@@ -116,7 +117,7 @@ module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics)
116
117
 
117
118
  for (const [index, {type, value}] of leadingComments.entries()) {
118
119
  if (type === 'CommentLine') {
119
- if (!path.isClassProperty() || index)
120
+ if (index || !path.isClassProperty() && !path.isBinaryExpression())
120
121
  maybe.indent(isIndent);
121
122
 
122
123
  maybeInsideFn(insideFn, {
@@ -134,6 +135,12 @@ module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics)
134
135
  if (index === count) {
135
136
  maybe.print.breakline(propIs);
136
137
  maybe.print.newline(!propIs);
138
+
139
+ if (isBinaryExpression(path)) {
140
+ indent.inc();
141
+ indent();
142
+ indent.dec();
143
+ }
137
144
  } else {
138
145
  print.newline();
139
146
  }
@@ -22,4 +22,3 @@ module.exports.ExportDefaultDeclaration = {
22
22
  print.newline();
23
23
  },
24
24
  };
25
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "12.23.1",
3
+ "version": "12.24.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",