facebook / facebook/jscodeshift

Missing simple examples for new users

Open
#193 11 comments 7 reactions 0 assignees View on GitHub
Add To Docs documentation
Dominant language
JavaScript
Stars
10k
Forks
498
PR merge metrics
No merged PRs in 30d

Description

I have never used jscodeshift, but have identified it as being potentially useful for a couple of simple use cases.

For example, I would like to change an object literal in code.

Before:

```js
// Some code ...

const someObj = {
x: {
foo: 3
}
};

// Some more code ...
```

After:

```js
// Some code ...

const someObj = {
x: {
foo: 4,
bar: '5'
}
};

// Some more code ...
```

But there are no examples of changing values. In general, this repo is very thin on examples. Google and Stackoverflow don't seem to point to any relevant information. None of the linked examples are helpful. [jscodeshift-helper](https://www.npmjs.com/package/jscodeshift-helper) doesn't help. Every example I have found so far is for complex use cases rather than something simple like changing the literal value of something.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.