Converting Rematch models to TypeScript
To get started on migrating our project to TypeScript, we'll need some steps that will be common for any project:
- Create a configuration file for TypeScript.
- Rename files to TypeScript files.
- Installing declaration files and TypeScript dev dependency.
These steps will largely be required on all the projects you create with TypeScript, even without using Rematch. In this chapter, we won't explain every type we need to add to make the migration complete since it would become larger than desired. You can look at the result in the GitHub repository of the book, and you could also read the official TypeScript documentation regarding how to migrate from a JavaScript code base: https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html.
Creating the configuration file
Let's get started by creating a configuration file. We just need to create a tsconfig.json
file in the root of our project...