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

307 B

Fix optional chaining as computed key (#17486 by @fisker)

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