Repository: prettier/prettier (JavaScript)

Issue:
Unstable comment location - after the last parameter property
<!--

BEFORE SUBMITTING AN ISSUE:

1.  Search for your issue on GitHub: https://github.com/prettier/prettier/issues
    A large number of opened issues are duplicates of existing issues.
    If someone has already opened an issue for what you are experiencing,
    you do not need to open a new issue — please add a 👍 reaction to the
    existing issue instead.

2.  We get a lot of requests for adding options, but Prettier is
    built on the principle of being opinionated about code formatting.
    This means we add options only in the case of strict technical necessity.
    Find out more: https://prettier.io/docs/en/option-philosophy.html

Don't fill the form below manually! Let a program create a report for you:

1. Go to https://prettier.io/playground
2. Paste your code and set options
3. Press the "Report issue" button in the lower right

-->

**Prettier 3.0.2**
[Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgMIbY7AA6UOOkUmMATgK5gwS0AUZFnOADrQJYA3dPBy046ACbRUATx7pa6ALYAFWhCQ4AKjO5wANB04B6Y5QhKlCGEYCUxIwF8yjkPpARuMPtEzJQCuoA7ioKCH4o6KhB6DJ+7gBGimAA1nAwAMrKcAAyfFBwyABmUZgGIEnoqekZ3FX5AObIdPTlZUp8zQxtjahwAIr0EPDFpeUAVpgAHhm9A0MjSCWoZe4Ajgtwap4RIFgAtAVwEsduIHTofKiNeBZK6Mh7qKhnmHMAgjB0fAn08CpwWh5AqjFblAAWMCUqAA6uC+PBMHUwHAMuEEYIETJHmBsGcBK0AJJQE6wDJgfhed4kjIwGR9UGrEC8CBlGGKbiPXhwMq0ASFdz5XkwNToBr3RnlOq0XmPOl6TAUvheM68fIwGF8CQwcHIAAcAAZ3GINnwxKLxQ8lmN3DB0AlNdrdUgAEzuehlLT2iLLJlwJQJY4nCQ5dBQBr0MVwABiLHuX0aj3QfwgIEcjiAA)
<!-- prettier-ignore -->
```sh
--parser typescript
```

**Input:**
<!-- prettier-ignore -->
```tsx
class Class {
  constructor(
      private readonly paramProp: Type,
    // comment
  ) {
  }
}
```

**Output:**
<!-- prettier-ignore -->
```tsx
class Class {
  constructor(private readonly paramProp: Type) // comment
  {}
}

```

**Second Output:**
<!-- prettier-ignore -->
```tsx
class Class {
  constructor(
    private readonly paramProp: Type, // comment
  ) {}
}


```

**Expected behavior:**

Comment location should be stable.

Similar to #11639


Hints:
Tip: We have <kbd>show second format</kbd> option in playgroud left panel.

Patch:
diff --git a/src/language-js/comments/handle-comments.js b/src/language-js/comments/handle-comments.js
--- a/src/language-js/comments/handle-comments.js
+++ b/src/language-js/comments/handle-comments.js
@@ -576,8 +576,8 @@ function handleLastFunctionArgComments({
       precedingNode?.type === "AssignmentPattern" ||
       precedingNode?.type === "ObjectPattern" ||
       precedingNode?.type === "ArrayPattern" ||
-      precedingNode?.type === "RestElement") &&
-    enclosingNode &&
+      precedingNode?.type === "RestElement" ||
+      precedingNode?.type === "TSParameterProperty") &&
     isRealFunctionLikeNode(enclosingNode) &&
     getNextNonSpaceNonCommentCharacter(text, locEnd(comment)) === ")"
   ) {


Test patch:
diff --git a/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap
--- a/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/format/typescript/comments/__snapshots__/jsfmt.spec.js.snap
@@ -694,6 +694,31 @@ export class Point {
 ================================================================================
 `;
 
+exports[`ts-parameter-proerty.ts format 1`] = `
+====================================options=====================================
+parsers: ["typescript"]
+printWidth: 80
+                                                                                | printWidth
+=====================================input======================================
+class A {
+  constructor(
+      private readonly paramProp: Type,
+    // comment
+  ) {
+  }
+}
+
+=====================================output=====================================
+class A {
+  constructor(
+    private readonly paramProp: Type,
+    // comment
+  ) {}
+}
+
+================================================================================
+`;
+
 exports[`type_literals.ts format 1`] = `
 ====================================options=====================================
 parsers: ["typescript"]
diff --git a/tests/format/typescript/comments/ts-parameter-proerty.ts b/tests/format/typescript/comments/ts-parameter-proerty.ts
new file mode 100644
--- /dev/null
+++ b/tests/format/typescript/comments/ts-parameter-proerty.ts
@@ -0,0 +1,7 @@
+class A {
+  constructor(
+      private readonly paramProp: Type,
+    // comment
+  ) {
+  }
+}