diff --git a/changelog_unreleased/javascript/14077.md b/changelog_unreleased/javascript/14077.md new file mode 100644 index 000000000000..730cf3d1d9bd --- /dev/null +++ b/changelog_unreleased/javascript/14077.md @@ -0,0 +1,19 @@ +#### Add parentheses to head of `ExpressionStatement` instead of the whole statement (#14047 by @fisker) + + +```jsx +// Input +({}).toString.call(foo) === "[object Array]" + ? foo.forEach(iterateArray) + : iterateObject(foo); + +// Prettier stable +({}.toString.call(foo) === "[object Array]" + ? foo.forEach(iterateArray) + : iterateObject(foo)); + +// Prettier main +({}).toString.call(foo.forEach) === "[object Array]" + ? foo.forEach(iterateArray) + : iterateObject(foo); +```