Support for NumericLiteralSeparator, Stage 1 feature#5793
Conversation
Codecov Report
@@ Coverage Diff @@
## 7.0 #5793 +/- ##
==========================================
+ Coverage 84.81% 84.82% +0.01%
==========================================
Files 282 283 +1
Lines 9875 9877 +2
Branches 2777 2776 -1
==========================================
+ Hits 8375 8378 +3
+ Misses 991 990 -1
Partials 509 509
Continue to review full report at Codecov.
|
|
@hzoo ready for an initial review! |
| @@ -0,0 +1,35 @@ | |||
| # babel-plugin-syntax-numeric-separator | |||
|
|
|||
|
|
|||
There was a problem hiding this comment.
To be consistent across package READMEs, could you add there a description:
# babel-plugin-syntax-numeric-separator
> Transforms blablabla
## Installation
[...]We should maybe add this to the spec implementor documentation.
|
Nice job @rwaldron. Do we want to backport that to 6.x? |
|
I'd like to not have to backport features, especially if it's a proposal? |
|
@xtuc PR updated with amended commit; now includes: https://github.com/babel/babel/pull/5793/files#diff-921c1523bfcb64eefcc009dba96e1a3bR3 |
| # babel-plugin-syntax-numeric-separator | ||
|
|
||
| Allow parsing of Numeric Literals (Decimal, Binary, Hex and Octal) that contain a _NumericLiteralSeparator_. | ||
| > Allow parsing of Numeric Literals (Decimal, Binary, Hex and Octal) that contain a _NumericLiteralSeparator_. |
There was a problem hiding this comment.
I initially typed this as well (my transform plugin has >) but then looked at README.md files in other babel-plugin-syntax-* packages and the ones I looked at didn't have this, eg. https://github.com/babel/babel/tree/7.0/packages/babel-plugin-syntax-async-functions
I'll open an issue and do the work to update them all, if you'd like
There was a problem hiding this comment.
Yes, that's correct. I can update them as well if you'd like.
|
@rwaldron I assume the test failures are because it doesn't have your patch yet? I published 7.0.0-beta.12 yesterday so just have to update the 3 deps to use it - can just grep for https://github.com/babel/babylon/releases/tag/v7.0.0-beta.12 |
|
@hzoo all deps updated to 7.0.0-beta.12, and patch rebased |
|
|
||
| `boolean`, defaults to `false`. | ||
|
|
||
| By default, this plugin will only remove the separators, printing Decimal, Binary, Hex and Octal number representations. Enabling this option will convert them all to a Decimal value. |
There was a problem hiding this comment.
extra space here?
We do have a http://babeljs.io/docs/plugins/transform-es2015-literals/ to deal with this already so in the ideal case this plugin would defer to that for the transformation. Not sure how that fits but interesting in relation to #5735. I'm ok with doing this atm though.
There was a problem hiding this comment.
This section has been removed.
2f98ebc to
94f029f
Compare
commit cd8f6e0 Author: Sven SAULEAU <xtuc@users.noreply.github.com> Date: Wed May 31 16:14:15 2017 +0200 docs: update README [skip ci] commit cf013e3 Author: Rick Waldron <waldron.rick@gmail.com> Date: Tue May 30 14:51:20 2017 -0400 Support for NumericLiteralSeparator, Stage 1 feature Signed-off-by: Rick Waldron <waldron.rick@gmail.com> Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
hzoo
left a comment
There was a problem hiding this comment.
looks good, I added a note about using a preset instead of an individual plugin
Not ready for mergeSigned-off-by: Rick Waldron waldron.rick@gmail.com
Adds support for Numeric Separator