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
visual-studio-code tslint


source to share


No one has answered this question yet

Check out similar questions:

1023
Always open files in a new tab
626
How do I collapse sections of code in Visual Studio Code for Windows?
553
Vertical rulers in Visual Studio Code?
499
Multiple cursors in Visual Studio Code
285
Hide .js.map files in Visual Studio Code
245
How do I hide certain files from the sidebar in Visual Studio Code?
ten
How do I customize Visual Studio Code and tslint?
0
TSLint Configuration in VS Code
0
Can't execute task in VS Code to run gulpfile.js
0
Visual Studio Code 2017 and Gulp - tasks show but aren't working?



All Articles
Loading...
X
Show
Funny
Dev
Pics