Enforcing a consistent code style improves the readability of the code base, but it can be a pain, even if ESLint reminds us to do this. Wouldn't it be great if those semicolons we forgot to add to the end of our statements were just automatically added for us? Well, that is what automatic code formatting tools can do for us, and Prettier is one of these great tools.
Adding automatic code formatting to React and TypeScript
Adding Prettier
We are going to add Prettier to our project by following these steps in Visual Studio Code:
- Make sure you are in the frontend directory and execute the following command to install Prettier:
> npm install prettier --save-dev
- Now, we want Prettier to take responsibility for the...