SHARE:

Getting started with TsLint and tslint-consistent-codestyle in Angular 5+ projects, Part 2: VSTS builds integration

Introduction

This article will help you configure TSLINT and some more code style rules to enforce consistent code style in your Angular application.
We are using Angular 5 in Visual Studio Code for this tutorial and VSTS to run a Continuous Integration (CI) build.

Step 1

Create a build definition in VSTS.

Configure your source repository location.

Step 2

Setup your agent phase, name it and select an Agent queue:

Step 3

Install dependencies simply by selecting the “install” command:

Step 4

Configure the build using a “custom” command like this:

Step 5

Configure TsLint using a “custom” command like this:

Step 6

Run the VSTS CI build and check your log 😊

If your code doesn’t respect your TsLint rules it should make your build fail:

Good luck 😉

Written by

anthonygiretti

Anthony is a specialist in Web technologies (14 years of experience), in particular Microsoft .NET and learns the Cloud Azure platform. He has received twice the Microsoft MVP award and he is also certified Microsoft MCSD and Azure Fundamentals.