add more plugins, rename some
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
*.log
|
||||
src
|
||||
@@ -0,0 +1,35 @@
|
||||
# babel-plugin-syntax-trailing-function-commas
|
||||
|
||||
Compile trailing function commas to ES5
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ npm install babel-plugin-syntax-trailing-function-commas
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["syntax-trailing-function-commas"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
$ babel --plugins syntax-trailing-function-commas script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["syntax-trailing-function-commas"]
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "babel-plugin-syntax-trailing-function-commas",
|
||||
"version": "1.0.0",
|
||||
"description": "Compile trailing function commas to ES5",
|
||||
"repository": "babel/babel",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export default function () {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.features["es7.trailingFunctionCommas"] = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user