3

I have a custom problem matcher for ESLint problems from vue-cli-service serve. It works fine and also watches all file changes correctly.

My problem is when I open a file, then ESLint extension of VS Code starts reporting the same problems again for the opened file. I end up either with duplicate problems for the same files, or having ESLint extension overwrites my custom problem matcher's problems which causes the problem to be removed after closing the files.

I know why this is happening but I want to get rid of duplicate problems and at the same time I want to keep the problems after closing the files.

Any idea how to solve this problem?

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "serve",
            "problemMatcher": [
                {
                    "owner": "eslint",
                    "fileLocation": ["absolute"],
                    "pattern": [
                      {
                        "regexp": "^([^\\s].*)$",
                        "file": 1
                      },
                      {
                        "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
                        "line": 1,
                        "column": 2,
                        "severity": 3,
                        "message": 4,
                        "code": 5,
                        "loop": true
                      }
                    ],
                    "background": {
                        "activeOnStart": true,
                        "beginsPattern": "^Module Warning \\(from \\.\\/node_modules\\/eslint-loader\\/index\\.js\\):$",
                        "endsPattern": "^✖ \\d+ problem \\(\\d+ errors, \\d+ warning\\)$"
                    }
                  }
            ],
            "isBackground": true,
            "label": "npm: serve",
            "detail": "vue-cli-service serve"
        }
    ]
}
geeko
  • 2,649
  • 4
  • 32
  • 59

1 Answers1

0

I have a similar issue: the problems caught by the GCC problem matcher are mixed with the problems detected by clang-tidy. Some problems might be reported twice. When I want to see the problem matcher output only, I simply enter gcc into the search box on the problems page. That filters out the clang-tidy output.

vjalle
  • 549
  • 4
  • 13