@putout/printer 2.90.0 → 2.91.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.07.31, v2.91.0
2
+
3
+ feature:
4
+ - 0a095e1 ts-tuple-type: newline
5
+
1
6
  2023.07.28, v2.90.0
2
7
 
3
8
  feature:
@@ -16,6 +16,7 @@ function ClassProperty(path, {print, maybe}) {
16
16
  declare,
17
17
  optional,
18
18
  } = node;
19
+
19
20
  const value = path.get('value');
20
21
  const typeAnnotation = path.get('typeAnnotation');
21
22
 
@@ -24,7 +24,7 @@ module.exports.TSTypeAliasDeclaration = {
24
24
  maybe.print.newline(!is);
25
25
  },
26
26
  afterIf(path, {store}) {
27
- const last = store();
27
+ const last = store() || isLast(path.parentPath);
28
28
 
29
29
  if (last)
30
30
  return false;
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- module.exports.TSTupleType = (path, {write, traverse, indent}) => {
3
+ module.exports.TSTupleType = (path, {write, traverse, indent, maybe}) => {
4
4
  const elementTypes = path.get('elementTypes');
5
5
 
6
6
  write('[');
7
7
  indent.inc();
8
- write.newline();
8
+ maybe.write.newline(elementTypes.length);
9
9
 
10
10
  for (const elementType of elementTypes) {
11
11
  indent();
@@ -18,3 +18,4 @@ module.exports.TSTupleType = (path, {write, traverse, indent}) => {
18
18
  indent();
19
19
  write(']');
20
20
  };
21
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "2.90.0",
3
+ "version": "2.91.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",