c6e7c1966e
* Add tests showing existing behavior of various TS casts. * Improve formatting of TS casts with generics and unions. By adding a soft break between the cast and the expression. Also includes wrapping parentheses for clarity as suggested in #4171. Avoids changing behavior at all though if casting an array or object literal because those already have good behavior where the array or object literal breaks before the cast does so including them would just result in a pointless extra layer of parentheses that would add no clarity. * Update tests in prepation for updating long cast format. * Update so nested breaks inside type cast are indented. * Add tests where expression being cast is too long itself. * Update cast formatting to only sometimes break after cast. Specifically it will break after the cast if that makes the cast itself fit on a single line. If the cast itself won't fit on a single line then the expression being cast will be placed directly after the `>` at the end of the cast. |
||
---|---|---|
.. | ||
__snapshots__ | ||
generic-cast.ts | ||
hug-args.ts | ||
jsfmt.spec.js | ||
parenthesis.ts |