@putout/printer 6.7.0 → 6.8.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,13 @@
1
+ 2023.11.30, v6.8.1
2
+
3
+ fix:
4
+ - 7df97ad @putout/printer: duplicate comments
5
+
6
+ 2023.11.30, v6.8.0
7
+
8
+ feature:
9
+ - 82cd2e3 @putout/printer: leading comments in SpreadElement ObjectProperty
10
+
1
11
  2023.11.29, v6.7.0
2
12
 
3
13
  feature:
@@ -17,6 +17,7 @@ const {
17
17
  isVariableDeclarator,
18
18
  isClassProperty,
19
19
  isTSPropertySignature,
20
+ isSpreadElement,
20
21
  } = types;
21
22
 
22
23
  const isProperty = satisfy([
@@ -24,6 +25,7 @@ const isProperty = satisfy([
24
25
  isVariableDeclarator,
25
26
  isClassProperty,
26
27
  isTSPropertySignature,
28
+ isSpreadElement,
27
29
  ]);
28
30
 
29
31
  module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics) => {
@@ -138,4 +138,3 @@ module.exports.ArrayExpression = {
138
138
  indent.inc();
139
139
  },
140
140
  };
141
-
@@ -59,7 +59,9 @@ module.exports.ObjectExpression = (path, printer, semantics) => {
59
59
  if (property.isSpreadElement()) {
60
60
  const logical = isLogical(property);
61
61
 
62
- maybe.indent(length > 1 || logical || manyLines);
62
+ if (noLeadingComment(property))
63
+ maybe.indent(length > 1 || logical || manyLines);
64
+
63
65
  print(property);
64
66
 
65
67
  if (length > 1 || manyLines) {
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- module.exports.SpreadElement = (path, {print}) => {
3
+ module.exports.SpreadElement = (path, printer) => {
4
+ const {print} = printer;
4
5
  print('...');
5
6
  print('__argument');
6
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "6.7.0",
3
+ "version": "6.8.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",