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
Question: examples directory #57
Comments
I agree that examples of how to use the API would be useful, but I'm not sure how useful contrived examples would be. https://github.com/cpojer/js-codemod/ contains a couple of transforms that are actually used, which could serve as examples. They may need a some more explanation / comments. cc @cpojer |
There are also some examples bundled with the React repo. It might be worth linking to these places from the README (if we don't already). |
@jhgg is working on some too https://github.com/jhgg/js-transforms (from #codemod in reactiflux) |
Maybe we should just create a wiki page that links to projects using jscodeshift. |
I am working on learning code modding. My examples probably aren't the best. Always looking for feedback on what I did wrong and what I can do better. |
Wiki sounds ok - and @jhgg you can always add tests |
The wiki idea is great. At the end, having examples from multiple sources is enough for getting started, just the three links you mentioned seem to have a lot of value for learning purposes. |
Made a simple wiki page: https://github.com/facebook/jscodeshift/wiki/Codemod-Examples for now |
Thanks @hzoo! |
Thank you! |
How do you guys feel about adding this to the README? The problem with the wiki on GitHub is that it isn't discoverable. And if this is just 3-5 links it doesn't hurt adding an "Examples" section to the readme I think. |
Sounds good since theres only 2 links right now and no link to it (unless you link to the wiki on the readme) |
Yeah, I would just link the wiki from the readme. |
There aren't any simple examples, such as how to change the literal value of an object property that has a specific name. |
56: identify components with refs as impure
Hi,
I have been reviewing this awesome project and I think it would be cool if the repo had an
examples
directory where novices (like me) could review some possible transformers. So far the only examples I have seen are at http://astexplorer.net/ and https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb. Conceptually, there are not many projects like this so maybe a bunch of examples showing the potential of the transformers would ease the learning curve.Would you accept PRs with examples or you prefer to leave them outside this repository? If affirmative, which structure would you prefer?
Cheers
The text was updated successfully, but these errors were encountered: