Using TypeScript
We’ve already installed TypeScript back in Adding TypeScript by using the tsc_watch tool to run TypeScript’s type checker over our code base, and then using esbuild to convert our TypeScript code into JavaScript. TypeScript’s configuration is managed by a tsconfig.json file, which basically specifies what TypeScript allows and the kind of code that TypeScript emits. (I’ll talk about more about the tsconfig.json file in Chapter 13, Validating Code with Advanced TypeScript.)
With TypeScript in place and with tsc_watch, every time we make a file change the TypeScript type checker will run, and if all its type checking passes, esbuild will convert it to JavaScript that can be sent to the browser. If the type checking does not ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access