Prevent multiple parenthesis around superclass with typecast (#12226)
This commit is contained in:
1 parent
86a9e222d9
commit
69ea417f6b
4 files changed
+21
-5
No files matched your search
@@ -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) {}
|
||||
```
|
||||
Reference in new issue
Block a user