{"id":15529789,"url":"https://github.com/mheap/problem-matcher","last_synced_at":"2025-10-29T01:39:31.224Z","repository":{"id":36947425,"uuid":"233069338","full_name":"mheap/problem-matcher","owner":"mheap","description":"Problem Matcher implementation in node.js","archived":false,"fork":false,"pushed_at":"2024-06-18T06:15:39.000Z","size":590,"stargazers_count":9,"open_issues_count":8,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T01:06:04.710Z","etag":null,"topics":["matcher","nodejs","problem","problem-matcher","vscode"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mheap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-10T14:55:52.000Z","updated_at":"2024-12-09T17:11:48.000Z","dependencies_parsed_at":"2024-05-01T18:45:24.347Z","dependency_job_id":"99effae6-0de7-442b-b9ab-cd3cebb8665f","html_url":"https://github.com/mheap/problem-matcher","commit_stats":{"total_commits":14,"total_committers":3,"mean_commits":4.666666666666667,"dds":0.2857142857142857,"last_synced_commit":"aaedc8f105601a507616bdf4a06527c01f6e54cb"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mheap%2Fproblem-matcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mheap%2Fproblem-matcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mheap%2Fproblem-matcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mheap%2Fproblem-matcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mheap","download_url":"https://codeload.github.com/mheap/problem-matcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986311,"owners_count":21194025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matcher","nodejs","problem","problem-matcher","vscode"],"created_at":"2024-10-02T11:19:55.701Z","updated_at":"2025-10-29T01:39:31.163Z","avatar_url":"https://github.com/mheap.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Problem Matcher\n\nThis library runs Problem Matcher definitions against an input and outputs any matches. These matches can then be used to add annotations etc to source code (like Github Actions does).\n\nThe inputs used for tests have been taken from [problem matchers](https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md)\n\n## Installation\n\n```\nnpm install problem-matcher\n```\n\n## Usage\n\nPass single Problem matcher and any input you have to the function and it will return a list of annotations.\n\n```javascript\nconst matcher = require(\"problem-matcher\");\nconst results = matcher(yourMatcher, input);\n```\n\nSee below for `yourMatcher` format examples.\n\n### Single Pattern\n\n```javascript\nconst eslintSingleMatcher = {\n  owner: \"eslint-compact\",\n  pattern: [\n    {\n      regexp:\n        \"^(.+):\\\\sline\\\\s(\\\\d+),\\\\scol\\\\s(\\\\d+),\\\\s(Error|Warning|Info)\\\\s-\\\\s(.+)\\\\s\\\\((.+)\\\\)$\",\n      file: 1,\n      line: 2,\n      column: 3,\n      severity: 4,\n      message: 5,\n      code: 6\n    }\n  ]\n};\n\nconst input = \"badFile.js: line 50, col 11, Error - 'myVar' is defined but never used. (no-unused-vars)\";\n\nconst result = matcher(eslintSingleMatcher, input);\n\n// result\n[{\n  file: \"badFile.js\",\n  line: \"50\",\n  column: \"11\",\n  severity: \"Error\",\n  message: \"'myVar' is defined but never used.\",\n  code: \"no-unused-vars\"\n}]\n```\n\n### Loop Pattern\n\n```javascript\nconst eslintLoopMatcher = {\n  owner: \"eslint-stylish\",\n  pattern: [\n    {\n      // Matches the 1st line in the output\n      regexp: \"^([^\\\\s].*)$\",\n      file: 1\n    },\n    {\n      // Matches the 2nd and 3rd line in the output\n      regexp: \"^\\\\s+(\\\\d+):(\\\\d+)\\\\s+(error|warning|info)\\\\s+(.*)\\\\s\\\\s+(.*)$\",\n      // File is carried through from above, so we define the rest of the groups\n      line: 1,\n      column: 2,\n      severity: 3,\n      message: 4,\n      code: 5,\n      loop: true\n    }\n  ]\n};\n\nconst input = `test.js\n  1:0   error  Missing \"use strict\" statement                 strict\n  5:10  error  'addOne' is defined but never used             no-unused-vars\n\nfoo.js\n  36:10  error  Expected parentheses around arrow function argument  arrow-parens\n  37:13  error  Expected parentheses around arrow function argument  arrow-parens\n\n✖ 4 problems (4 errors, 0 warnings)`;\n\nconst result = matcher(eslintLoopMatcher, input);\n\n// result\n[\n  {\n    file: \"test.js\",\n    line: \"1\",\n    column: \"0\",\n    severity: \"error\",\n    message: 'Missing \"use strict\" statement',\n    code: \"strict\"\n  },\n  {\n    file: \"test.js\",\n    line: \"5\",\n    column: \"10\",\n    severity: \"error\",\n    message: \"'addOne' is defined but never used\",\n    code: \"no-unused-vars\"\n  },\n  {\n    file: \"foo.js\",\n    line: \"36\",\n    column: \"10\",\n    severity: \"error\",\n    message: \"Expected parentheses around arrow function argument\",\n    code: \"arrow-parens\"\n  },\n  {\n    file: \"foo.js\",\n    line: \"37\",\n    column: \"13\",\n    severity: \"error\",\n    message: \"Expected parentheses around arrow function argument\",\n    code: \"arrow-parens\"\n  }\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmheap%2Fproblem-matcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmheap%2Fproblem-matcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmheap%2Fproblem-matcher/lists"}