To start the TypeScript shift for our Cherry CLI project, let's focus on the cherry.js file—it's the sweet spot for adding typing. What we want to do first is break down each command into functions. This not only cleans up our code but makes testing a whole lot easier.
This is only the first step of three:
- Split cherry.js file into functions <--
- Unit test cherry.js functions
- Migrate cherry.js to TypeScript