ProblemMatcher in VS Code using invalid file for gulp-tslint task

tasks.json in .settings of project root

{
    "version": "0.1.0",
    "command": "gulp",
    "isShellCommand": true,
    "tasks": [
    {
        "taskName": "dev",
        "args": [],
        "isBuildCommand": true,
        "problemMatcher": [
        "$tsc",
        "$jshint"
        ]
    },
    {
        "taskName": "tslint",
        "fileLocation": ["absolute"],
        "problemMatcher": [
        {
            "pattern": {
            "regexp": "\\[[^\\]]+\\] \\[[^\\]]+\\] (\\S+) \\([^\\)]+\\) ([^\\[]+)\\[(\\d+), (\\d+)\\]: (.+)",
            "file": 2,
            "line": 3,
            "column": 4,
            "severity": 1,
            "message": 5
            }
        }
        ]
    }
    ]
}

      

Sample output of a tslint task:

[17:35:12] [gulp-tslint] error (no-unused-variable) C:\repo\IgnitionOne\stable\prototype-coresettings\src\server\controllers\userController.ts[38, 9]: unused variable: 'test'

      

Unescaped Regex:

\[[^\]]+\] \[[^\]]+\] (\S+) \([^\)]+\) ([^\[]+)\[(\d+), (\d+)\]: (.+)

      

When I test my regex on online testing tools, it pulls all groups out correctly. When I look at problems in the code with CTRL + SHIFT + M, I see an error when the file path, name and message are all correct. However, when I click on the error, I get:

Error opening 'userController.ts' (File not found).

And if I click "Create File":

ENOENT: no such file or directory, mkdir "C: \ repo \ IgnitionOne \ stable \ coresettings prototypes \ c:

I reviewed it with a fellow developer and it is not clear why this is happening. This is similar to the location of the file relative to the workspace root and mapping only "c:" in a group of files. Any ideas on what is not configured correctly?

+3


source to share





All Articles