Fix optional chaining as computed key (#17486)
This commit is contained in:
1 parent
55405ce082
commit
242b524eb1
7 files changed
+284
-1
No files matched your search
@@ -0,0 +1,20 @@
|
||||
#### Fix optional chaining as computed key (#17486 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
const a = { [y?.z]() {} };
|
||||
class A { [y?.z]() {} };
|
||||
|
||||
// Prettier stable
|
||||
const a = { [y?.z]?() {} };
|
||||
class A {
|
||||
[y?.z]?() {}
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
const a = { [y?.z]() {} };
|
||||
class A {
|
||||
[y?.z]() {}
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user