Visual Studio Code

Challenge 6: TSLint Problems

Visual Studio Code

Check out a free preview of the full Visual Studio Code course

The "Challenge 6: TSLint Problems" Lesson is part of the full, Visual Studio Code course featured in this preview video. Here's what you'd learn in this lesson:

In this challenge, students create a custom task to run TSLint and capture output.

Preview
Close

Transcript from the "Challenge 6: TSLint Problems" Lesson

[00:00:00]
>> Mike North: So what we're gonna do now, this is the last exercise I'm gonna ask you to do today, is we're going to run this linter. It's called TSLint, and this is the command that you wanna run. So we're gonna create a task that will run this. Here is the sample output, spits out things like this.

[00:00:19]
You can see that here is a file name, here is a line and a column number, and then here's a message. So we want to basically emit this or we want to run this script, which will then print these lines and our problem matcher will detect this. And you should see problems start to stack up down here as we find these linting errors.

[00:00:44]
This is the equivalent of ESLint, but it's for typescript. So we're gonna create this custom task. I keep double-clicking. Create the custom task to run TSLint, define a regex-based Problem Matcher to capture the output and then fix all the bugs that it points out. And if you want to learn a new hot key here, F8 will cycle through any of the problems.

[00:01:05]
So let's just worry about the tasks, and then in about 15 minutes we'll go through it together. Don't worry about fixing the problems for now, we'll do that together once we get it straight.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now