@putout/printer 2.51.0 → 2.53.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,15 @@
1
+ 2023.07.06, v2.53.0
2
+
3
+ feature:
4
+ - c1c667d @putout/printer: ObjectExpression: comma
5
+
6
+ 2023.07.06, v2.52.0
7
+
8
+ feature:
9
+ - fd9bcf3 @putout/printer: JSXEmptyExpression: add
10
+ - 29bdc0b package: eslint-plugin-putout v18.0.0
11
+ - 1e83b78 package: @putout/compare v11.0.0
12
+
1
13
  2023.07.05, v2.51.0
2
14
 
3
15
  feature:
@@ -39,7 +39,7 @@ module.exports.ObjectExpression = (path, {print, maybe, indent, write}, semantic
39
39
  maybe.indent(length > 1 || logical || manyLines);
40
40
  print(property);
41
41
 
42
- if (!logical && (length > 1 || manyLines)) {
42
+ if (length > 1 || manyLines) {
43
43
  print(',');
44
44
  print.newline();
45
45
  }
@@ -65,7 +65,6 @@ module.exports.ObjectExpression = (path, {print, maybe, indent, write}, semantic
65
65
  indent.dec();
66
66
  maybe.indent(manyLines);
67
67
  print('}');
68
- maybe.print.newline(shouldAddNewline(path));
69
68
  maybe.print(parens, ')');
70
69
  };
71
70
 
@@ -92,13 +91,6 @@ const notLastArgInsideCall = (path) => {
92
91
  .at(-1);
93
92
  };
94
93
 
95
- function shouldAddNewline(path) {
96
- if (!path.parentPath.isLogicalExpression())
97
- return false;
98
-
99
- return path.parentPath.parentPath.isSpreadElement();
100
- }
101
-
102
94
  const ONE_LINE = true;
103
95
  const MANY_LINES = false;
104
96
 
@@ -6,6 +6,7 @@ const {isCoupleLines} = require('../is');
6
6
  const {JSXOpeningElement} = require('./jsx-opening-element');
7
7
  const fragments = require('./jsx-fragment');
8
8
  const {JSXText} = require('./jsx-text');
9
+ const {parseComments} = require('../comments/comments');
9
10
 
10
11
  module.exports = {
11
12
  ...fragments,
@@ -13,6 +14,9 @@ module.exports = {
13
14
  JSXAttribute,
14
15
  JSXOpeningElement,
15
16
  JSXText,
17
+ JSXEmptyExpression(path, operations, semantics) {
18
+ parseComments(path, operations, semantics);
19
+ },
16
20
  JSXExpressionContainer(path, {print}) {
17
21
  print('{');
18
22
  print('__expression');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "2.51.0",
3
+ "version": "2.53.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",
@@ -30,7 +30,7 @@
30
30
  "@babel/parser": "^7.19.0",
31
31
  "@babel/traverse": "^7.21.2",
32
32
  "@babel/types": "^7.21.3",
33
- "@putout/compare": "^10.0.0",
33
+ "@putout/compare": "^11.0.0",
34
34
  "@putout/operate": "^8.11.0",
35
35
  "fullstore": "^3.0.0",
36
36
  "just-snake-case": "^3.2.0",
@@ -59,7 +59,7 @@
59
59
  "escover": "^3.0.0",
60
60
  "eslint": "^8.0.1",
61
61
  "eslint-plugin-n": "^16.0.0",
62
- "eslint-plugin-putout": "^17.0.0",
62
+ "eslint-plugin-putout": "^18.0.0",
63
63
  "estree-to-babel": "^5.0.1",
64
64
  "just-kebab-case": "^4.2.0",
65
65
  "madrun": "^9.0.0",