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

Update docs & document how to view docs #272

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ You can collect even more stats via the `stats` function as explained above.

### Parser

The transform can let jscodeshift know with which parser to parse the source
The transform can let jscodeshift know with which parser to parse the source
files (and features like templates).

To do that, the transform module can export `parser`, which can either be one
of the strings `"babel"`, `"babylon"`, or `"flow"`, or it can be a parser
To do that, the transform module can export `parser`, which can either be one
of the strings `"babel"`, `"babylon"`, or `"flow"`, or it can be a parser
object that is compatible with recast.

For example:
Expand Down Expand Up @@ -317,7 +317,7 @@ This can be done by passing config options to [recast].
.toSource({quote: 'single'}); // sets strings to use single quotes in transformed code.
```

You can also pass options to recast's `parse` method by passing an object to
You can also pass options to recast's `parse` method by passing an object to
jscodeshift as second argument:

```js
Expand Down Expand Up @@ -363,6 +363,13 @@ const transform = require('../myTransform');
defineInlineTest(transform, {}, 'input', 'expected output', 'test name (optional)');
```

### Local Documentation Server
To update docs in `/docs`, use `npm run docs`.

To view these docs locally, use `npx http-server ./docs`



### Example Codemods

- [react-codemod](https://github.com/reactjs/react-codemod) - React codemod scripts to update React APIs.
Expand Down