@putout/printer 1.115.1 → 1.116.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,14 @@
1
+ 2023.05.25, v1.116.0
2
+
3
+ feature:
4
+ - f7890b6 @putout/printer: ObjectPattern: space
5
+
6
+ 2023.05.25, v1.115.2
7
+
8
+ feature:
9
+ - 8facda2 @putout/printer: ArrayPattern: spaces
10
+ - f21b441 package: eslint-plugin-n v16.0.0
11
+
1
12
  2023.05.25, v1.115.1
2
13
 
3
14
  fix:
@@ -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
- maybe.print(isNewLine, ',\n');
20
- maybe.print(!isNewLine && index < n, ', ');
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();
@@ -50,7 +50,8 @@ module.exports.ObjectPattern = {
50
50
  maybe.print(computed, ']');
51
51
 
52
52
  if (!shorthand || wrongShorthand({computed, isAssign, keyPath, valuePath})) {
53
- print(': ');
53
+ print(':');
54
+ print.space();
54
55
  print(valuePath);
55
56
  } else if (isAssign) {
56
57
  print(valuePath);
@@ -9,7 +9,6 @@ const {
9
9
  } = require('../is');
10
10
 
11
11
  const {hasPrevNewline} = require('../mark');
12
-
13
12
  const {isExportDeclaration} = require('@babel/types');
14
13
 
15
14
  const isParentBlock = (path) => /Program|BlockStatement|Export/.test(path.parentPath.type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.115.1",
3
+ "version": "1.116.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",
@@ -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": "^15.2.4",
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",