microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 35 forks source link

ProblemMatcher not working for TSLint >= 5.12 #93

Closed probert94 closed 5 years ago

probert94 commented 5 years ago

Since version 5.12.0 the prose formatter uses line:column instead of [line, column]. The tslint5 ProblemMatcher is still using the old pattern and therefore, the problems won't be matched. The new pattern should be something like this: ^(WARNING|ERROR):(\\s+\\(\\S*\\))?\\s+(\\S.*):(\\d+):(\\d+)\\s+-\\s+(.*)$

As a temporary workaround I overwrite the pattern in my task definition:

"problemMatcher": {
    "base": "$tslint5",
    "pattern": {
        "regexp": "^(WARNING|ERROR):(\\s+\\(\\S*\\))?\\s+(\\S.*):(\\d+):(\\d+)\\s+-\\s+(.*)$",
        "severity": 1,
        "file": 3,
        "line": 4,
        "column": 5,
        "message": 6
    }
}
mjbvz commented 5 years ago

Can you submit a PR that makes this change?

probert94 commented 5 years ago

@mjbvz should a new matcher be added to stay compatible with tslint 5.11 and older?

mjbvz commented 5 years ago

Yes it probably should be a new one, unless you can write a regex that supports both outputs