@putout/printer 18.44.0 → 18.45.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,13 @@
1
+ 2026.09.13, v18.45.0
2
+
3
+ feature:
4
+ - 96b799c3 @putout/printer: ClassDeclaration: definite
5
+
6
+ 2026.09.12, v18.44.1
7
+
8
+ fix:
9
+ - 4b4e5037 comments: parse-trailing-comments: no loc
10
+
1
11
  2026.09.10, v18.44.0
2
12
 
3
13
  feature:
@@ -76,6 +76,9 @@ function isCommentOnNextLine(path) {
76
76
  if (next.node && line < next.node.loc?.start.line)
77
77
  return false;
78
78
 
79
+ if (!loc)
80
+ return true;
81
+
79
82
  const startLine = loc.start.line;
80
83
  const endLine = loc.end.line;
81
84
  const isNextLine = line === startLine + 1 && line === endLine + 1;
@@ -13,6 +13,7 @@ const processClassProperty = maybeDecorators((path, printer) => {
13
13
  accessibility,
14
14
  declare,
15
15
  optional,
16
+ definite,
16
17
  } = node;
17
18
 
18
19
  const {print, maybe} = printer;
@@ -31,6 +32,7 @@ const processClassProperty = maybeDecorators((path, printer) => {
31
32
  printKey(path, printer);
32
33
 
33
34
  maybe.print(optional, '?');
35
+ maybe.print(definite, '!');
34
36
 
35
37
  maybePrintTypeAnnotation(path, printer);
36
38
 
@@ -4,7 +4,9 @@ import {
4
4
  } from '#is';
5
5
  import {createTypeChecker} from '#type-checker';
6
6
 
7
- const callWithLastDecorator = (fn) => (path) => fn(path.get('decorators').at(-1));
7
+ const callWithLastDecorator = (fn) => (path) => fn(
8
+ path.get('decorators').at(-1),
9
+ );
8
10
 
9
11
  const isIndent = createTypeChecker([
10
12
  ['-', hasLeadingComment],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "18.44.0",
3
+ "version": "18.45.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer for 🐊Putout",
@@ -89,8 +89,9 @@
89
89
  "@putout/plugin-react-hook-form": "^6.0.0",
90
90
  "@putout/plugin-react-hooks": "^9.0.0",
91
91
  "@supertape/operator-strip": "^1.0.0",
92
+ "@typescript/native": "npm:typescript@^7.0.2",
92
93
  "acorn": "^8.8.2",
93
- "check-dts": "^1.0.0",
94
+ "check-dts": "^2.0.0",
94
95
  "escover": "^6.0.0",
95
96
  "eslint": "^10.0.0",
96
97
  "eslint-plugin-putout": "^31.0.0",
@@ -105,8 +106,7 @@
105
106
  "samadhi": "^4.0.2",
106
107
  "superc8": "^12.2.4",
107
108
  "supertape": "^13.2.0",
108
- "try-catch": "^4.0.6",
109
- "typescript": "^6.0.2"
109
+ "try-catch": "^4.0.6"
110
110
  },
111
111
  "license": "MIT",
112
112
  "engines": {