Christopher Chedeau
789a3029f4
Remove +1 from newline detection ( #261 )
...
* Remove +1 from newline detection
All the changes are related to spurious `;`. Sometimes the logic is more correct, sometimes less. Since `;` are going to be removed after the first save, I don't think it matters that much.
* Handle inconsistent `end` node locations when looking for newlines
2017-01-17 22:33:55 -05:00
Christopher Chedeau
8e0f97e410
Break multiline imports ( #167 )
...
Follows the same pattern as https://github.com/jlongster/prettier/pull/156/files
```js
echo "import { aaaaaaaa, bbbbbb, cccccc, dddddddd, eeeeeee, fffffffff, ggggggggg } from 'vjeux';" | ./bin/prettier.js --stdin
import {
aaaaaaaa,
bbbbbb,
cccccc,
dddddddd,
eeeeeee,
fffffffff,
ggggggggg
} from "vjeux";
```
2017-01-13 12:59:33 -05:00
James Long
aab300844f
Use group instead of conditionalGroup
2017-01-12 14:53:12 -05:00
Benjamin Tan
1549936e68
Break long `exports` into multiple lines.
...
Ref #19 .
2017-01-12 14:38:22 -05:00
James Long
00fad62c91
Regenerate snapshots
2017-01-11 10:16:38 -05:00
Benjamin Tan
d56365dd54
Add semicolons to `export` declarations.
...
Closes #22 .
2017-01-11 20:43:27 +08:00
Dan Harper
7c21dd037f
Fix import & export bracket spacing ( fixes #24 )
2017-01-11 00:32:57 +00:00
James Long
d2d6def9be
Revert "fixes #49 : omit new parens when it has no arguments"
...
This reverts commit b5392f9468
.
2017-01-10 18:53:03 -05:00
Michael Ficarra
b5392f9468
fixes #49 : omit new parens when it has no arguments
2017-01-10 11:14:39 -08:00
James Long
a4643f1bae
Add special case for comment at top of file; regenerate snapshots
2017-01-09 21:49:26 -05:00
James Long
bcd44b4368
Keep blank lines from original source
2017-01-09 09:46:09 -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
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
6715abca76
Tweak variable declaration printing
2016-12-30 11:56:42 -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