Prevent multiple parenthesis around superclass with typecast (#12226)

This commit is contained in:
Lucas Duailibe authored and GitHub committed 2022-02-05 11:56:37 -03:00
1 parent 86a9e222d9
commit 69ea417f6b
4 files changed
+21 -5

No files matched your search

+6 -4
View File
@@ -1,13 +1,15 @@
#### Fix moving comments after `extends` in class declarations (#12222 by @duailibe)
#### Fix typecast of superclass in class declarations (#12222 & #12226 by @duailibe)
This was a combination of two separate bugs: moving the comments before the superclass and adding multiple parenthesis around the superclass.
<!-- prettier-ignore -->
```js
// Input
class Foo extends /* comment explaining Bar */ Bar {}
class Foo extends /** @type {Type} */ (Bar) {}
// Prettier stable
class Foo /* comment explaining Bar */ extends Bar {}
class Foo /** @type {Type} */ extends ((Bar)) {}
// Prettier main
class Foo extends /* comment explaining Bar */ Bar {}
class Foo extends /** @type {Type} */ (Bar) {}
```