Рет қаралды 323
In this video, we explore how to use jscodeshift for automated code transformations, following a Test-Driven Development (TDD) approach. We start with an introduction to codemods and then dive into writing and testing transformations with jscodeshift. We also cover Abstract Syntax Trees (ASTs) and the AST Explorer tool. By the end of this video, you'll know how to use the jscodeshift CLI to apply codemods to your codebase effectively.
*Table of Contents:*
- 01:04 - Short intro of codemod
- 04:00 - jscodeshift
- 08:54 - Write a test
- 10:48 - Test the transform
- 13:35 - Write the transform skeleton
- 14:21 - AST Explorer
- 17:17 - Implementing the transform
- 21:06 - Make the test pass
- 23:28 - Apply codemod to target codebase
- 25:16 - Wrapping up
Watch the full video to master jscodeshift and streamline your codebase refactoring process. Don't forget to like, comment, and subscribe for more coding tutorials!
Links:
- www.hypermod.io/
- astexplorer.net/
- github.com/fac...
- github.com/abr...
Subscribe to my newsletter for more articles and videos on refactoring and clean code tips: juntao.substac...
Additional Resources:
- React Anti-Patterns: www.amazon.com...
- React Clean Code Book: leanpub.com/re...
- Maintainable React Book: leanpub.com/ma...
- Mastering Maintainable React Course: www.udemy.com/...