Commit Graph

10 Commits (master)

Author SHA1 Message Date
Ika f4bcb13d41
feat(typescript): support TS 3.4 (#6027)
- add support for `readonly` operator
- `as const` was already supported, added tests to ensure no regression
2019-04-04 15:32:54 +08:00
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Kevin Donnelly c6e7c1966e Improve formatting of TS casts with generics and unions (#4219)
* 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.
2018-05-07 22:26:01 -06:00
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Lucas Azzola 4a0e9475df Print parens around type assertion as LHS in assignment, fixes #2521 (#2525) 2017-07-20 23:16:15 +10:00
Lucas Azzola b25935d7a3 TypeScript: allow type assertions to hug (#2439)
* TypeScript: allow type assertions to hug, fixes #2437

* Update snapshots
2017-07-10 22:37:43 +10:00
Lucas Azzola 8bbbc3a6f3 Remove parens for type assertions in binary expressions, fixes #2416 (#2419) 2017-07-07 13:02:43 +02:00
Christopher Chedeau 7ab73e688d Add parenthesis around arrow functions in a cast (#1689) 2017-05-23 16:30:47 -07:00
Christopher Chedeau 19486bdd17 Add parenthesis for ternaries inside of a cast (#1680) 2017-05-23 12:33:32 -07:00