Skip to content

Commit 2ea4a15

Browse files
author
Robert Jackson
committed
Add details on custom extensions to README.
1 parent 4ddb5eb commit 2ea4a15

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ can update your project's README and your transforms README via:
5757
codemod-cli update-docs
5858
```
5959

60+
### File Types
61+
62+
By default the bin script that is generated for your `codemod-cli` project will run against `.js` and `.ts` files.
63+
If you'd like to change that (e.g. to run against `.hbs` or `.jsx` files) you can tweak your projects `bin/cli.js` script
64+
to add `--extensions=hbs,jsx`:
65+
66+
```js
67+
#!/usr/bin/env node
68+
'use strict';
69+
70+
require('codemod-cli').runTransform(
71+
__dirname,
72+
process.argv[2] /* transform name */,
73+
process.argv.slice(3) /* paths or globs */
74+
75+
'--extensions=hbs,jsx'
76+
)
77+
```
78+
6079
Contributing
6180
------------------------------------------------------------------------------
6281

0 commit comments

Comments
 (0)