move out syntax plugins to babel/babel-archive, they don't need to be updated (#6229)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-es2015-arrow-functions",
|
||||
"syntax-async-functions",
|
||||
"transform-async-to-generator",
|
||||
"external-helpers"
|
||||
]
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@@ -1,50 +0,0 @@
|
||||
# babel-plugin-syntax-async-functions
|
||||
|
||||
> This plugin allows Babel to parse async functions.
|
||||
|
||||
## Example
|
||||
|
||||
**Syntax**
|
||||
|
||||
```javascript
|
||||
(async function() {
|
||||
await loadStory();
|
||||
console.log("Yey, story successfully loaded!");
|
||||
}());
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev babel-plugin-syntax-async-functions
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["syntax-async-functions"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins syntax-async-functions script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["syntax-async-functions"]
|
||||
});
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
* [Proposal: Async Functions for ECMAScript](https://github.com/tc39/ecmascript-asyncawait)
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "babel-plugin-syntax-async-functions",
|
||||
"version": "7.0.0-beta.0",
|
||||
"description": "Allow parsing of async functions",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-functions",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
export default function() {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("asyncFunctions");
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@@ -1,35 +0,0 @@
|
||||
# babel-plugin-syntax-exponentiation-operator
|
||||
|
||||
> Allow parsing of the exponentiation operator.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev babel-plugin-syntax-exponentiation-operator
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["syntax-exponentiation-operator"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins syntax-exponentiation-operator script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("babel-core").transform("code", {
|
||||
plugins: ["syntax-exponentiation-operator"]
|
||||
});
|
||||
```
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "babel-plugin-syntax-exponentiation-operator",
|
||||
"version": "7.0.0-beta.0",
|
||||
"description": "Allow parsing of the exponentiation operator",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-exponentation-operator",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
export default function() {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("exponentiationOperator");
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@@ -1,122 +0,0 @@
|
||||
# babel-plugin-syntax-trailing-function-commas
|
||||
|
||||
> Compile trailing function commas to ES5
|
||||
|
||||
|
||||
```js
|
||||
function clownPuppiesEverywhere(
|
||||
param1,
|
||||
param2,
|
||||
) { /* ... */ }
|
||||
|
||||
clownPuppiesEverywhere(
|
||||
'foo',
|
||||
'bar',
|
||||
);
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
### Basic
|
||||
This is an example from the [Proposal](https://github.com/jeffmo/es-trailing-function-commas).
|
||||
|
||||
Let's say you have this function:
|
||||
|
||||
```js
|
||||
function clownPuppiesEverywhere(
|
||||
param1,
|
||||
param2
|
||||
) { /* ... */ }
|
||||
|
||||
clownPuppiesEverywhere(
|
||||
'foo',
|
||||
'bar'
|
||||
);
|
||||
```
|
||||
|
||||
If you want to have a new parameter called `param3`, the diff output would be like that:
|
||||
|
||||
```diff
|
||||
function clownPuppiesEverywhere(
|
||||
param1,
|
||||
- param2
|
||||
+ param2, // Change this line to add a comma
|
||||
+ param3 // Add param3
|
||||
) { /* ... */ }
|
||||
|
||||
clownPuppiesEverywhere(
|
||||
'foo',
|
||||
- 'bar'
|
||||
+ 'bar', // Change this line to add a comma
|
||||
+ 'baz' // Add param3
|
||||
);
|
||||
```
|
||||
In total, you have to change 2 lines for the function declaration and 2 lines for each usage.
|
||||
|
||||
If you had your function defined with trailing commas:
|
||||
|
||||
```js
|
||||
function clownPuppiesEverywhere(
|
||||
param1,
|
||||
param2,
|
||||
) { /* ... */ }
|
||||
|
||||
clownPuppiesEverywhere(
|
||||
'foo',
|
||||
'bar',
|
||||
);
|
||||
```
|
||||
Adding a new parameter would only change one line in the function declaration and one line for each usage:
|
||||
|
||||
```diff
|
||||
function clownPuppiesEverywhere(
|
||||
param1,
|
||||
param2,
|
||||
+ param3, // Add param3
|
||||
) { /* ... */ }
|
||||
|
||||
clownPuppiesEverywhere(
|
||||
'foo',
|
||||
'bar',
|
||||
+ 'baz', // Add param3
|
||||
);
|
||||
```
|
||||
In the end, your diff output will be cleaner and easier to read, it would be much quicker to add a new parameter to your functions, it also makes it easier to copy paste elements and move code around.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev 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"]
|
||||
});
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
* [Proposal](https://github.com/jeffmo/es-trailing-function-commas)
|
||||
* [Spec](http://jeffmo.github.io/es-trailing-function-commas/)
|
||||
* [Why you should enforce Dangling Commas for Multiline Statements](https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8)
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "babel-plugin-syntax-trailing-function-commas",
|
||||
"version": "7.0.0-beta.0",
|
||||
"description": "Compile trailing function commas to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-trailing-function-commas",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"devDependencies": {
|
||||
"babel-helper-plugin-test-runner": "7.0.0-beta.0"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
export default function() {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("trailingFunctionCommas");
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
(x, y, ) => {};
|
||||
@@ -1 +0,0 @@
|
||||
(x, y) => {};
|
||||
@@ -1,4 +0,0 @@
|
||||
Math.max(1,
|
||||
2,
|
||||
3,
|
||||
);
|
||||
@@ -1 +0,0 @@
|
||||
Math.max(1, 2, 3);
|
||||
@@ -1,8 +0,0 @@
|
||||
function thisIsAFunctionWithAVeryLongNameAndWayTooManyParameters(
|
||||
thisIsTheFirstParameter, andThisOneIsRelatedToIt,
|
||||
butNotThisOne,
|
||||
andNeitherThis,
|
||||
inFactThereArentThatManyParameters,
|
||||
) {
|
||||
throw null;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
function thisIsAFunctionWithAVeryLongNameAndWayTooManyParameters(thisIsTheFirstParameter, andThisOneIsRelatedToIt, butNotThisOne, andNeitherThis, inFactThereArentThatManyParameters) {
|
||||
throw null;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
new Foo(a, b,);
|
||||
@@ -1 +0,0 @@
|
||||
new Foo(a, b);
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"plugins": ["syntax-trailing-function-commas"]
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// builtin module
|
||||
require("path");
|
||||
// relative module
|
||||
require("../../../../lib");
|
||||
@@ -1,3 +0,0 @@
|
||||
import runner from "babel-helper-plugin-test-runner";
|
||||
|
||||
runner(__dirname);
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"syntax-async-functions",
|
||||
["transform-es2015-classes", { "loose": true }]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
{
|
||||
"plugins": ["transform-class-properties", "external-helpers", "syntax-flow", "transform-es2015-parameters", "transform-es2015-block-scoping", "transform-es2015-spread", "transform-es2015-classes", "transform-es2015-destructuring", "transform-es2015-arrow-functions", "syntax-async-functions", "transform-es2015-for-of"]
|
||||
"plugins": [
|
||||
"transform-class-properties",
|
||||
"external-helpers",
|
||||
"syntax-flow",
|
||||
"transform-es2015-parameters",
|
||||
"transform-es2015-block-scoping",
|
||||
"transform-es2015-spread",
|
||||
"transform-es2015-classes",
|
||||
"transform-es2015-destructuring",
|
||||
"transform-es2015-arrow-functions",
|
||||
"transform-es2015-for-of"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
{
|
||||
"plugins": [["transform-class-properties", {"loose": true}], "external-helpers", "syntax-flow", "transform-es2015-parameters", "transform-es2015-block-scoping", "transform-es2015-spread", "transform-es2015-classes", "transform-es2015-destructuring", "transform-es2015-arrow-functions", "syntax-async-functions", "transform-es2015-for-of"]
|
||||
}
|
||||
"plugins": [
|
||||
["transform-class-properties", {"loose": true}],
|
||||
"external-helpers",
|
||||
"syntax-flow",
|
||||
"transform-es2015-parameters",
|
||||
"transform-es2015-block-scoping",
|
||||
"transform-es2015-spread",
|
||||
"transform-es2015-classes",
|
||||
"transform-es2015-destructuring",
|
||||
"transform-es2015-arrow-functions",
|
||||
"transform-es2015-for-of"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
{
|
||||
"plugins": ["transform-class-properties", "external-helpers", "syntax-flow", ["transform-es2015-parameters", { "loose": true } ], "transform-es2015-block-scoping", "transform-es2015-spread", "transform-es2015-classes", "transform-es2015-destructuring", "transform-es2015-arrow-functions", "syntax-async-functions", "transform-es2015-for-of"]
|
||||
"plugins": [
|
||||
"transform-class-properties",
|
||||
"external-helpers",
|
||||
"syntax-flow",
|
||||
["transform-es2015-parameters", { "loose": true } ],
|
||||
"transform-es2015-block-scoping",
|
||||
"transform-es2015-spread",
|
||||
"transform-es2015-classes",
|
||||
"transform-es2015-destructuring",
|
||||
"transform-es2015-arrow-functions",
|
||||
"transform-es2015-for-of"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-flow-strip-types", "syntax-async-functions"]
|
||||
"plugins": ["transform-flow-strip-types"]
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
"transform-es2015-unicode-regex",
|
||||
"transform-regenerator",
|
||||
"transform-exponentiation-operator",
|
||||
"transform-async-to-generator",
|
||||
"syntax-trailing-function-commas"
|
||||
"transform-async-to-generator"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-exponentiation-operator",
|
||||
"syntax-async-functions",
|
||||
"transform-regenerator",
|
||||
"transform-es2015-template-literals",
|
||||
"transform-es2015-literals",
|
||||
|
||||
Reference in New Issue
Block a user