What are the options available to us when we want to quickly spin up a React.js application, and how do we choose one that will work for us?
We’ll be using Vite throughout the course and here we’ll explore it in more detail, then execute the command for Vite to initialise an application for us. Handy :)
-
I use VSCode
for my development environment. I have a lot of different plugins to help, but the big ones to pick up are:
-
I use iterm2
for my terminal. Within that, I use:
-
Combining VSCode
and iterm2
:
-
For TypeScript: always remember to add your types. We’ll go into this in a bit more detail later in the course, but in general, if your linter is complaining and you’re getting errors related to type definition, then follow the little tooltip that often comes up or just thing “I probably need to install types for the package I’m using”. It’s always a good rule of thumb. You only need types in your development environment, not in the code you build for production, so to install types you can simply say: npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser
or npm install --save-dev @types/testing-library__jest-dom
for example. That would install types for the TS ESLint parser and the Jest-DOM packages respectively.
-
For ESLint errors in general: if you truly think you’ve resolved the error but it’s not going away, try doing a Developer: Reload Window
in VSCode. To do that on a mac, you type cmd + shift + p
to get up the Command Pallete. This will then allow you to type ‘developer’ and the option to select Developer: Reload Window
should pop up. Always give that a try before pulling your hair out 🙂
-
On yellow errors from ESLint: Don’t sweat them too much. Red lines are bad and will likely break your application, but yellow lines are more about code quality. They should be addressed, but don’t have to be.