Repository: prettier/prettier (JavaScript)

Issue:
JSDoc super class type override becomes broken
**Prettier 2.3.2**
[Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAucAbAhgZ0wAgCo5wAe8UAJrgPQBU1OAAjAJ4AOcOwAYhBADwBC6AE4A+AL45qlHAApuEAJQcxIADQgILGAEtomZKGFCIAdwAKwhPpTpUJ9E33qARkPRgA1nBgBlFu+0oAHNkGCEAVzh1OABbZzgyMgSAGXRg8PQguG4hGPQYHWDkEHRwmAg1EAALGBjUAHUq7XhMfzA4Hytm7QA3ZqZisGxKwMw4IRgzNyC85AAzWzH1ACtMIn43T28fdBi4ZMC4ecWokFWiH0Cg1DgARXCIeGPUJZB-ITGhYud0eNRKlhCQIweraMgwKrIAAcAAZ1ICIGN6m4WMVAXBPj0juoAI4PeBTTTWEqYAC0UDgCQSlSEcDx2lpU0ysyQCxepzGMW0oQiHKuN3ujyOrJO6hgv1B4MhSAATGK3NpUFcAMIQGIskAYgCslXCYzwv2sbNePUiAElyAhfGAgVoAILkHzMG7PMZiMRAA)
<!-- prettier-ignore -->
```sh
--parser babel
```

**Input:**
<!-- prettier-ignore -->
```jsx
class T extends /** @type {Foo<Bar>} */ (Foo) {}
```

**Output:**
<!-- prettier-ignore -->
```jsx
class T /** @type {Foo<Bar>} */ extends ((Foo)) {}

```

**Expected behavior:**
```jsx
class T extends /** @type {Foo<Bar>} */ (Foo) {}
```

The type override is needed to specify the generic type and should not be moved.


Hints:
@wmertens Yeah, Prettier shouldn't move this comment, it's a bug.

But unrelated to the bug, shouldn't the syntax be something like this?

```js
/** @extends {Foo<Bar>} */
class T extends Foo {}
```
I wish, it looks like the extends keyword can't use generics. i can't get it to work in any case 
Is that using tsc? [This](https://www.typescriptlang.org/play?filetype=js#code/PQKhAIAEBcFMFsAOAbAhncAVcJgCgBjNAZ2PADEB7S8Abz3HFAkgCdZoBXVgOzNswBfHPkYBzDuABm1ABQBKOg0bh2XXkxbQAnolh0hI8D07JkAbmWC81vMyiwAHnB4ATMlUoAeYtFYBLHjEAPhFCEjIAQXAnF3cKajpbexhdfV8AoLCCSj5ocEdwAF5jWAB3cEiFADoZSks7MAdnWDcPai8TeAAjWFZQ3HDUUnAAIRiWtoSaWmSm1L1jTh6+7NzfcG1i0orRmrrzIA) works for me and in the playground

Patch:
diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js
--- a/src/language-js/needs-parens.js
+++ b/src/language-js/needs-parens.js
@@ -95,7 +95,6 @@ function needsParens(path, options) {
           node.type === "LogicalExpression" ||
           node.type === "NewExpression" ||
           node.type === "ObjectExpression" ||
-          node.type === "ParenthesizedExpression" ||
           node.type === "SequenceExpression" ||
           node.type === "TaggedTemplateExpression" ||
           node.type === "UnaryExpression" ||


Test patch:
diff --git a/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap
--- a/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/format/js/comments-closure-typecast/__snapshots__/jsfmt.spec.js.snap
@@ -603,6 +603,20 @@ const OverlapWrapper =
 ================================================================================
 `;
 
+exports[`superclass.js format 1`] = `
+====================================options=====================================
+parsers: ["babel"]
+printWidth: 80
+                                                                                | printWidth
+=====================================input======================================
+class Foo extends /** @type {string} */ (Bar) {}
+
+=====================================output=====================================
+class Foo extends /** @type {string} */ (Bar) {}
+
+================================================================================
+`;
+
 exports[`ways-to-specify-type.js format 1`] = `
 ====================================options=====================================
 parsers: ["babel"]
diff --git a/tests/format/js/comments-closure-typecast/superclass.js b/tests/format/js/comments-closure-typecast/superclass.js
new file mode 100644
--- /dev/null
+++ b/tests/format/js/comments-closure-typecast/superclass.js
@@ -0,0 +1 @@
+class Foo extends /** @type {string} */ (Bar) {}