Skip to main content

2 posts tagged with "advanced"

View All Tags

· 9 min read
Mohab Sameh

In the previous tutorial, we discussed how to take your codemod skills to the next level by applying the techniques used by professionals to write a codemod like no-vars.

In this tutorial, we take it one step further by writing test cases that confirm that our codemods identify all essential code patterns and then perform transforms correctly and precisely. Writing tests for our codemods can significantly improve your codemod development process.

Keep reading to add this skill to your arsenal.

· 16 min read
Mohab Sameh

Writing codemods using imperative methods (like JSCodeShift for JS/TS) can be extremely powerful for code transformation. However, such codemods can be difficult to create, especially for new codemod authors.

In this article, we'll use what we've learned about ASTs and simple codemod development to tackle a real-world problem.