Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add j shorthand #153

Merged
merged 1 commit into from
Sep 27, 2016
Merged

Add j shorthand #153

merged 1 commit into from
Sep 27, 2016

Conversation

vjeux
Copy link
Contributor

@vjeux vjeux commented Sep 24, 2016

This way we can write

export default function transformer(file, { j }) {
  return j(file.source).toSource();
}

and not need to have the annoying local variable

export default function transformer(file, api) {
  const j = api.jscodeshift;

  return j(file.source).toSource();
}

This way we can write

```js
export default function transformer(file, { j }) {
  return j(file.source).toSource();
}
```

and not need to have the annoying local variable

```js
export default function transformer(file, api) {
  const j = api.jscodeshift;

  return j(file.source).toSource();
}
```
@ghost ghost added the CLA Signed label Sep 24, 2016
@fkling fkling merged commit a36720f into facebook:master Sep 27, 2016
@vjeux
Copy link
Contributor Author

vjeux commented Sep 27, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants