What is tsconfig.json for?

The tsconfig.json file specifies the root files and the compiler options required to compile a TypeScript project. So presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project. Without that file, the compiler will continue to move up the directory hierarchy to fine the config file. There is also a…

Strictness of Types

People, when they come to TypeScript, might have different ideas in mind with how strict they want types checked. Some people don’t want types at all, like JavaScript currently is, and want to use other aspects of TypeScript, while others might want to be very strict. The default experience with TypeScript, where types are optional,…

Custom Data Types in TypeScript

We’ve already seen the standard data types in JavaScript and TypeScript. However, JavaScript allows for class, and we want to therefore be able to define a custom data type within TypeScript. Since JavaScript supports classes and object-oriented programming, so does TypeScript. You can explicitly describe this object’s shape using an interface declaration. Then, to define an object…

Installing TypeScript

You will need to install the TypeScript engine for you to use TypeScript. This is because your TypeScript code must be converted into JavaScript, so it needs a program called a transpiler to do the conversion to JavaScript so that a browser can run it. What does a Transpiler Actually Do? A transpiler is not…