Support for NumericLiteralSeparator, Stage 1 feature (#5793)
* Support for NumericLiteralSeparator, Stage 1 feature commit cd8f6e062876261a334d968f875e477a48927b6d Author: Sven SAULEAU <xtuc@users.noreply.github.com> Date: Wed May 31 16:14:15 2017 +0200 docs: update README [skip ci] commit cf013e3382bf73cdf9224026c1ec0b1a368cfef2 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> * add note about presets [skip ci]
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
*.log
|
||||
src
|
||||
36
packages/babel-plugin-syntax-numeric-separator/README.md
Normal file
36
packages/babel-plugin-syntax-numeric-separator/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# babel-plugin-syntax-numeric-separator
|
||||
|
||||
> Allow parsing of Numeric Literals (Decimal, Binary, Hex and Octal) that contain a _NumericLiteralSeparator_.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev babel-plugin-syntax-numeric-separator
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["syntax-numeric-separator"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins syntax-numeric-separator script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["syntax-numeric-separator"]
|
||||
});
|
||||
```
|
||||
13
packages/babel-plugin-syntax-numeric-separator/package.json
Normal file
13
packages/babel-plugin-syntax-numeric-separator/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "babel-plugin-syntax-numeric-separator",
|
||||
"version": "7.0.0-alpha.12",
|
||||
"description": "Allow parsing of Decimal, Binary, Hex and Octal literals that contain a Numeric Literal Separator",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-numeric-separator",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export default function () {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("numericSeparator");
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user