Setting up TSLint for your project

Let's begin by installing TSLint with npm. You can do this by running the following command:

npm i --g tslint

This installs the linter library globally. To install it as a part of your project, you can run the following command:

npm i --save-dev tslint

Great! Now we have TSLint installed on our machine and on our project.

The crux of using TSLint revolves around setting up the static code analysis rules. So what exactly are these rules? You can take a look at the official TSLint website ( for a list of core rules.

These aren't the only rules that you can set up for your project, and there certainly is no enforcement of each of these rules to be used by you. We will ...

Get TypeScript High Performance now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.