Code that used to be formatted as if (! + object) { is now formatted as if (!+object) {
(we have a particular object in our codebase where unary operator+ is overloaded to return the underlying value, which in this case is a bool)
We still preserve the TypeScript behavior where ! is a trailing non-null operator. (This is already tested by an existing unit test in FormatTestJS.cpp)
It doesn't appear like handling of consecutive unary operators are tested in general, so I added another test for completeness
I think that TypeScript has both if (!cond) and x!. I'd expect that if (!+i) {\n} is also handled in the TypeScript case. Could you add a test for this for TypeScript please.