@putout/printer 1.115.0 → 1.115.2
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,14 @@
|
|
|
1
|
+
2023.05.25, v1.115.2
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 8facda2 @putout/printer: ArrayPattern: spaces
|
|
5
|
+
- f21b441 package: eslint-plugin-n v16.0.0
|
|
6
|
+
|
|
7
|
+
2023.05.25, v1.115.1
|
|
8
|
+
|
|
9
|
+
fix:
|
|
10
|
+
- a1c17a9 @putout/printer: ObjectProperty inside ObjectPattern after path.scope.rename() (babel/babel#15648)
|
|
11
|
+
|
|
1
12
|
2023.05.24, v1.115.0
|
|
2
13
|
|
|
3
14
|
feature:
|
|
@@ -16,8 +16,13 @@ module.exports.ArrayPattern = (path, {indent, maybe, print}) => {
|
|
|
16
16
|
for (const [index, element] of elements.entries()) {
|
|
17
17
|
maybe.indent(isNewLine);
|
|
18
18
|
print(element);
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
|
|
20
|
+
if (isNewLine) {
|
|
21
|
+
print(',\n');
|
|
22
|
+
} else if (index < n) {
|
|
23
|
+
print(',');
|
|
24
|
+
print.space();
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
indent.dec();
|
|
@@ -8,6 +8,10 @@ const {
|
|
|
8
8
|
exists,
|
|
9
9
|
} = require('../is');
|
|
10
10
|
|
|
11
|
+
const wrongShorthand = ({computed, isAssign, keyPath, valuePath}) => {
|
|
12
|
+
return !computed && !isAssign && keyPath.node.name !== valuePath.node.name;
|
|
13
|
+
};
|
|
14
|
+
|
|
11
15
|
const isOneParentProperty = ({parentPath}) => parentPath.parentPath.node.properties.length === 1;
|
|
12
16
|
|
|
13
17
|
module.exports.ObjectPattern = {
|
|
@@ -45,7 +49,7 @@ module.exports.ObjectPattern = {
|
|
|
45
49
|
print(keyPath);
|
|
46
50
|
maybe.print(computed, ']');
|
|
47
51
|
|
|
48
|
-
if (!shorthand) {
|
|
52
|
+
if (!shorthand || wrongShorthand({computed, isAssign, keyPath, valuePath})) {
|
|
49
53
|
print(': ');
|
|
50
54
|
print(valuePath);
|
|
51
55
|
} else if (isAssign) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "1.115.
|
|
3
|
+
"version": "1.115.2",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"c8": "^7.5.0",
|
|
55
55
|
"escover": "^3.0.0",
|
|
56
56
|
"eslint": "^8.0.1",
|
|
57
|
-
"eslint-plugin-n": "^
|
|
57
|
+
"eslint-plugin-n": "^16.0.0",
|
|
58
58
|
"eslint-plugin-putout": "^17.0.0",
|
|
59
59
|
"estree-to-babel": "^5.0.1",
|
|
60
60
|
"just-kebab-case": "^4.2.0",
|