我有一个来自 vue-cli-service serve
的 ESLint 问题的自定义问题匹配器。
它工作正常,还可以正确监视所有文件更改。
我的问题是当我打开一个文件时,VS Code 的 ESLint 扩展开始再次为打开的文件报告相同的问题。 我最终要么遇到相同文件的重复问题,要么 ESLint 扩展覆盖了我的自定义问题匹配器的问题,这导致问题在关闭文件后被删除。
我知道为什么会这样,但我想摆脱重复的问题,同时我想在关闭文件后保留这些问题。
知道如何解决这个问题吗?
{
"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"
}
]
}
最佳答案
我有一个类似的问题:GCC 问题匹配器捕获的问题与 clang-tidy 检测到的问题混合在一起。有些问题可能会被报告两次。 当我只想查看问题匹配器输出时,我只需在问题页面的搜索框中输入 gcc。这会过滤掉 clang-tidy 输出。
关于visual-studio-code - 如何处理 VS Code 中多个问题匹配器报告的重复问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65527321/