59 Commits

Author SHA1 Message Date
Brian Ng
e4b35f680d
Run prettier 2017-06-27 12:15:00 -05:00
Justin Ridgewell
d92309f0db PR comments 2017-06-07 03:22:52 -04:00
Justin Ridgewell
85b6b4b1b2 Print optional chain operator 2017-06-07 03:22:51 -04:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Andres Suarez
2bee765e6b Replace lodash is* with equivalent typeof check 2017-01-15 13:53:58 -08:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Dan Harper
d90aaf2c76 Print Flow optional & type annotations in function params with defaults (#4872)
Fixes #4863
2016-12-16 15:31:05 -05:00
Sean Larkin
39c92160f7 Add generator support for Import (#4945) 2016-12-07 18:22:12 -05:00
Logan Smyth
1b527eb23c Perform number decimal checks at the token level. 2016-07-18 19:12:21 -07:00
Logan Smyth
1bbf109e8e Move aux comments entirely into printer. 2016-07-17 21:51:01 -07:00
Logan Smyth
0e05e9f216 Rely on .space and .newline behavior instead of explicit format checks. 2016-07-17 12:39:22 -07:00
Logan Smyth
1bf76b0f33 Use .append to force-commit semicolons for empty statements. 2016-07-14 22:58:48 -07:00
Logan Smyth
b841d12c9e Initialize inForStatementInitCounter as a public var. 2016-07-14 22:58:47 -07:00
Logan Smyth
e4da8cfea5 Use the standard newline function. 2016-07-02 15:38:05 -07:00
Logan Smyth
df2c3f3d25 Use the common space helper everywhere to ensure we get the smallest output possible. 2016-06-16 22:00:24 -07:00
Logan Smyth
1514d0a1ad Drop some space-insertion logic. 2016-06-16 22:00:23 -07:00
Logan Smyth
4286cb4f2a Explicitly label standalone tokens and words. 2016-06-16 22:00:23 -07:00
Logan Smyth
e702e67233 Split all of the pushes into individual tokens. 2016-06-16 22:00:23 -07:00
Logan Smyth
8336aa52e8 Split all of the separators into functions. 2016-06-16 20:31:19 -07:00
dlwalsh
829d4497c9 remove micro modules in favour of lodash functions (#3500) 2016-05-15 22:00:50 -04:00
Jordan Klassen
dc1f40540d Upgrade to lodash 4 (#3315)
* Upgrade to lodash 4

* Fix incorrect require in babel-runtime/scripts

* Replace cloneDeep with cloneDeepWith where applicable
2016-05-13 17:15:14 -04:00
Amjad Masad
2fbe28cc88 Remove remaining @flow annotations 2016-03-03 15:10:59 -08:00
Amjad Masad
12ee11a0a4 Revert "Remove Flow annotations and pragmas"
This reverts commit 4252244d06b225ab26a02d52c04f9940a3e4d6a2.
2016-03-03 15:03:55 -08:00
Henry Zhu
66ea5342de Merge pull request #3379 from babel/memexp-numliteral
Fix: invalid codegen for non decimal numeric literals in MemberExpression
2016-02-29 11:40:30 -05:00
Henry Zhu
35ed18f628 Fix invalid codegen for non decimal numeric literals in MemberExpression
Fixes T7156
2016-02-28 20:34:45 -05:00
Sam Goldman
4252244d06 Remove Flow annotations and pragmas 2016-02-28 13:18:57 -10:00
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Zachary Miller
33b4ef5d52 Parenthize "in" in for-loop init, even when init has nested for-loop 2016-02-05 14:28:01 -06:00
Jordan Klassen
8fd329a2f4 Remove "Node" class from generator, just use module
The Node class was unused as a class
2016-02-03 16:51:10 -08:00
Sebastian McKenzie
65a4c8f4a4 Merge branch 'source-map-reenter' of https://github.com/kpdecker/babel into kpdecker-source-map-reenter
Conflicts:
	packages/babel-generator/src/printer.js
2016-01-18 18:36:57 +00:00
Amjad Masad
6abee425d3 Revert "babel-types: add Binary alias to AssignmentExpression definition (fixes T6887)"
This was causing problems with parenthesizing assignment expression
This reverts commit b5cf529d6b342b3dd8dd49c50cc9cd5fed4fc5a7.
2016-01-06 15:59:39 -08:00
Henry Zhu
b5cf529d6b babel-types: add Binary alias to AssignmentExpression definition (fixes T6887) 2016-01-01 14:44:28 -05:00
Henry Zhu
276c98f7f0 Remove await* from babel-generator, add parsing error to babylon - (fixes T6688) 2015-12-19 23:15:09 -05:00
kpdecker
9e382b1686 Fix aux comment termination in lists and calls 2015-12-18 01:37:26 -06:00
Amjad Masad
320cede9be Fix invalid codegen for number member expr 2015-12-15 17:47:46 -08:00
Amjad Masad
007ef5cdbb Use the leftMost from the right to check if we need spaces in BinaryExpressions 2015-12-14 13:36:52 -08:00
Amjad Masad
cb03a98b65 Add minified format option
As a follow up from #3145 we agreed to add a new format that is a
superset of the compact format option. Do things that are considered
dangerous. e.g. not printing semicolons, or print literal values
as opposed to raw values.
2015-12-09 17:34:23 -08:00
Amjad Masad
4b99d18ea7 Only reprint in compact mode 2015-12-07 10:59:50 -08:00
Amjad Masad
89e6d5bc7e Always print strings for consistency 2015-12-07 02:30:14 -08:00
Henry Zhu
6082ac8a59 skip nested new expressions 2015-12-05 14:19:31 -05:00
Henry Zhu
21f76655ad account for parent NewExpression with arguments 2015-12-05 13:37:06 -05:00
Henry Zhu
8a1ad5350c Merge pull request #3111 from amasad/new
No need for parens for new expressions without args
2015-12-05 13:33:23 -05:00
Amjad Masad
54a2a47030 Fix spacing in binary expression when right is a binary expression and has a unary on the left 2015-12-01 10:37:58 -08:00
Amjad Masad
c78c27a8d6 It's only valid if the node is the callee 2015-11-24 19:24:05 -08:00
Amjad Masad
486d781be3 Handle member expressions 2015-11-24 19:20:06 -08:00
Amjad Masad
f1f6c820fe Handle new X()() 2015-11-24 19:12:24 -08:00
Amjad Masad
d32fae6fcd No need for parens for new expressions without args 2015-11-24 19:07:03 -08:00
Amjad Masad
e481c5b570 use + instead of template string 2015-11-24 19:01:12 -08:00
Amjad Masad
e4c5d9dcb3 Respect compact mode in spacing 2015-11-24 19:01:12 -08:00