James Long
aed3c1af71
Handle curly brackets in SwitchCase types
2017-01-09 12:07:39 -05:00
James Long
bcd44b4368
Keep blank lines from original source
2017-01-09 09:46:09 -05:00
James Long
c10681d148
Pull out special chain printing into utility function
2017-01-08 14:44:44 -05:00
James Long
d5ab6ab921
Detect chained call expressions and format them specifically
2017-01-08 13:56:57 -05:00
James Long
5c39dc02e6
Improve intersection and union type annotation
2017-01-05 14:43:05 -05:00
James Long
7b0ec6d935
Break ternary ops across newlines if needed
2017-01-05 12:32:56 -05:00
James Long
fcd5436b38
Improve if/else printing and other clauses
2017-01-05 12:10:14 -05:00
James Long
835befebf5
Always output comment newlines, fix edge case with function param output
2017-01-04 22:26:46 -05:00
James Long
b550f1d088
Use , to separate type fields instead of ;
2017-01-04 17:26:44 -05:00
James Long
8326963f2d
Add option to include spaces inside object/array literals, default to false
2017-01-04 17:23:07 -05:00
James Long
98fef67b4e
Fix a bug with expanding function args by passing group opts properly
2017-01-04 17:08:28 -05:00
James Long
898009ba66
Consistently print function parameters the correct way
2017-01-04 16:52:49 -05:00
James Long
588c8ce7cd
Add `conditionalGroup` to allow manually specifying multiple representations of a document; use it to support expanding last parameter of functions
2017-01-04 15:24:10 -05:00
James Long
fa16988401
If function declaration is too long, break all args on separate lines; also fix small bug in output cleansing
2017-01-01 20:33:53 -05:00
James Long
37601b0a86
Update snapshots
2017-01-01 20:20:45 -05:00
James Long
c9e24eb477
Add spaces around certain statements, add --write option, and more
2016-12-30 23:01:07 -05:00
James Long
7ea2348b03
Various fixes with destructuring default, JSX, and more; all tests pass!
2016-12-30 17:00:11 -05:00
James Long
32d4200f60
Wrap class expressions in parens if needed
2016-12-30 14:25:52 -05:00
James Long
4dfaf9da98
Fix a few parens detection and more predicates
2016-12-30 14:10:52 -05:00
James Long
ed57110ef5
Add type parameters on anon functions
2016-12-30 13:41:45 -05:00
James Long
e972a7f0b6
Fix object and predicate annotations
2016-12-30 13:32:43 -05:00
James Long
6715abca76
Tweak variable declaration printing
2016-12-30 11:56:42 -05:00
James Long
73755a686d
Fix type annotation for optional function type properties
2016-12-30 00:08:03 -05:00
James Long
11a01552a4
Lots of bug fixes (will do smaller commits from now on)
2016-12-30 00:01:44 -05:00
James Long
88dc2681f6
Make all tests pass the crash test and fix a few more bugs
2016-12-27 21:40:04 -05:00
James Long
9acd34d67d
update snapshots
2016-12-27 13:29:31 -05:00
Christopher Chedeau
cf45afba61
Add testing
...
- This brings in the flow test suite that contains a ton of JavaScript parsing edge cases
- This creates snapshot tests using the pretty printer for all of them
- If uncomment `RUN_AST_TESTS` line in `tests/run_specs.js`, it checks ast(pretty_print(x)) == ast(x). Right now, "178 failed, 197 passed, 375 of 377 total". So half of the tests are not passing, most of them are crashes and many of the rest are subtle issues.
2016-12-23 19:51:53 +00:00