Files
test-repo/changelog_unreleased/javascript/17486.md
T

21 lines
307 B
Markdown

#### 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]() {}
}
```