TypeScript typings for the Github Actions problem matcher file format
npm install github-actions-problem-matcher-typingsts
import { problemMatcher as problemMatcherJson } from "../.github/problem-matcher.json";
import { ProblemMatcher } from "github-actions-problem-matcher-typings";
const problemMatcher: ProblemMatcher = problemMatcherJson[0];
describe("problemMatcher", () => {
it("has the correct name", () => {
expect(problemMatcher.owner).toEqual("your-matcher");
});
});
`
To load the problem matcher as a module you'll need to update your tsconfig.json like so:
`json
{
"compilerOptions": {
"resolveJsonModule": true / Allows for importing .json files as modules. /
}
}
``