@putout/printer 1.52.3 → 1.52.4
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
|
@@ -11,6 +11,8 @@ const {
|
|
|
11
11
|
markAfter,
|
|
12
12
|
} = require('../mark');
|
|
13
13
|
|
|
14
|
+
const {isExportDeclaration} = require('@babel/types');
|
|
15
|
+
|
|
14
16
|
const isParentBlock = (path) => /Program|BlockStatement|Export/.test(path.parentPath.type);
|
|
15
17
|
|
|
16
18
|
module.exports.VariableDeclaration = {
|
|
@@ -104,8 +106,10 @@ function shouldAddNewlineBefore(path) {
|
|
|
104
106
|
if (prevPath.isStatement() && !prevPath.isExpressionStatement() && !prevPath.isBlockStatement())
|
|
105
107
|
return false;
|
|
106
108
|
|
|
107
|
-
if (isCoupleLines(path))
|
|
109
|
+
if (!isExportDeclaration(path.parentPath) && isCoupleLines(path))
|
|
108
110
|
return true;
|
|
111
|
+
|
|
112
|
+
return false;
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
function isFirst(path) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "1.52.
|
|
3
|
+
"version": "1.52.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Easiest possible opinionated Babel AST printer made with ❤️ to use in 🐊Putout",
|