-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pablo Navarro
committed
May 25, 2019
1 parent
482e972
commit 9570a1e
Showing
9 changed files
with
10,376 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
extends: | ||
- airbnb-base | ||
- plugin:prettier/recommended |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "10" | ||
before_install: | ||
- npm ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,58 @@ | ||
# babel-plugin-ramda-no-useless-merge | ||
Babel Plugin to transform `R.merge(a, b)` → `{...a, ...b}` | ||
|
||
> Replaces `R.merge(a, b)` with `{ ...a, ...b }` | ||
## Installation | ||
|
||
Using npm | ||
|
||
```sh | ||
npm install --save-dev @pnavarrc/babel-plugin-ramda-no-useless-merge | ||
``` | ||
|
||
or using yarn | ||
|
||
```sh | ||
yarn add @pnavarrc/babel-plugin-ramda-no-useless-merge | ||
``` | ||
|
||
## Example | ||
|
||
### In | ||
|
||
```js | ||
const c = R.merge(a, b); | ||
``` | ||
|
||
### Out | ||
|
||
```js | ||
const c = { ...a, ...b }; | ||
``` | ||
|
||
## Usage | ||
|
||
### Via `.babelrc` | ||
|
||
```json | ||
{ | ||
"plugins": ["ramda-no-useless-merge"] | ||
} | ||
``` | ||
|
||
### Via CLI | ||
|
||
```shell | ||
babel --plugins ramda-no-useless-merge script.js | ||
``` | ||
|
||
## Learn More | ||
|
||
- [Babel Plugin Handbook](https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md) by [@thejameskyle](https://twitter.com/thejameskyle) | ||
- [Using Babel to Codemod your Code](https://youtu.be/Hn6Ca6gzNsw) by [@kentcdodds](https://twitter.com/kentcdodds) | ||
- [Frontend Masters Course - Code Transformation and Linting with ASTs](https://frontendmasters.com/courses/linting-asts/) by [@kentcdodds](https://twitter.com/kentcdodds) | ||
- [AST Explorer](https://astexplorer.net/) | ||
|
||
## License | ||
|
||
MIT |
Oops, something went wrong.