@putout/printer 2.31.0 → 2.32.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.06.19, v2.32.0
2
+
3
+ feature:
4
+ - 1e478d1 @putout/printer: VariableDeclarator: useless newline
5
+
1
6
  2023.06.19, v2.31.0
2
7
 
3
8
  feature:
@@ -6,7 +6,6 @@ const {
6
6
  isIdentifierAndIdentifier,
7
7
  isStringAndArray,
8
8
  isIndented,
9
-
10
9
  } = require('../../is');
11
10
 
12
11
  const {
@@ -107,4 +107,3 @@ module.exports.hasLeadingComment = (path) => path.node?.leadingComments?.length;
107
107
 
108
108
  module.exports.noTrailingComment = (path) => !path.node.trailingComments?.length;
109
109
  module.exports.noLeadingComment = (path) => !path.node.leadingComments?.length;
110
-
@@ -123,6 +123,12 @@ function notLastPrevVarNotNextVar(path) {
123
123
  const prev = path.getPrevSibling();
124
124
  const next = path.getNextSibling();
125
125
 
126
+ if (!exists(prev.getPrevSibling()))
127
+ return false;
128
+
129
+ if (path.node.loc?.start.line === prev.node?.loc?.start.line + 2)
130
+ return false;
131
+
126
132
  return !isLast(path) && prev.isVariableDeclaration() && !next.isVariableDeclaration();
127
133
  }
128
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "2.31.0",
3
+ "version": "2.32.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",