Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Navarro committed May 25, 2019
1 parent 482e972 commit 9570a1e
Show file tree
Hide file tree
Showing 9 changed files with 10,376 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/env"]
}
3 changes: 3 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extends:
- airbnb-base
- plugin:prettier/recommended
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "10"
before_install:
- npm ci
58 changes: 57 additions & 1 deletion README.md
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
Loading

0 comments on commit 9570a1e

Please sign in to comment.