Mittwoch, 22. Juli 2015

Creating a problemMatcher for gulp-tslint in Visual Studio Code

Recently I came up with the idea to parse the output of gulp-tslint to display it within Visual Studio Code to gather all errormessages at one single place. As Visual Studio Code does not provide an $tslint problemMatcher I created a custom one by adding a regular expression

Here you can see the regexp (line 18) to identify the lines in the console.log containing tslint messages. Line 19-22 are to map the capture-groups to the properties of Visual Studio Code error messages.


Its important to run tslint in full report-mode to capture the full path to the files. This enables Visual Studio Code to jump directly to the TypeScript files when clicking on the corresponding error messages.


You can find more information on this official page: Defining a problem matcher