Typescript Setup
Install with npm install -g typescript
You can install locally, but globally means we can run the command line tool tsc
anywhere.
You’ll want to create a tsconfig.json
file which tells the typescript compiler how to execute. You can do the same with command line flags, but don’t.
Initialize the config with tsc --init
. This will create the file in the current directory. Thereafter we can run the typescript compiler without passing options, and it will read from the config.
Some of the key settings include “strict” - try to leave it on.
“isolated modules” - can be helpful with babel.
“esModuleInterop” - makes it much easier to work with different module systems.
“skipLibcheck” - skips the node modules folder imports.