0

I desire a problem matcher which reports two kinds of problems:

  1. typescript compilation problems
  2. tslint problems

This isn't working in one of my projects, but is working in others. Here is the problem matcher line from the .vscode/tasks.json:

"problemMatcher": [
    "$tsc",
    {
        "owner": "tslint",
        "fileLocation": "relative",
        "severity": "error",
        "pattern": {
            "regexp": "^ERROR:\\s*(.*\\.ts)\\[(\\d+), (\\d+)\\]: (.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "message": 4
        }
    }
]
ChaseMoskal
  • 7,151
  • 5
  • 37
  • 50

1 Answers1

0

I believe the problems weren't being picked up, because they were being prefixed by browserify or tsify.

The following configuration solved the problem, and should report problems for regular tsc compilation, browserify/tsify compilation, and tslint:

"problemMatcher": [
    "$tsc",
    {
        "owner": "typescript",
        "fileLocation": ["relative", "${workspaceRoot}"],
        "pattern": {
            "regexp": "^TypeScript (warning|error): (.*)\\((\\d+),(\\d+)\\): (.*)$",
            "severity": 1,
            "file": 2,
            "line": 3,
            "column": 4,
            "message": 5
        }
    },
    {
        "owner": "tslint",
        "fileLocation": "relative",
        "severity": "error",
        "pattern": {
            "regexp": "^ERROR:\\s*(.*\\.ts)\\[(\\d+), (\\d+)\\]: (.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "message": 4
        }
    }
]
ChaseMoskal
  • 7,151
  • 5
  • 37
  • 50