diff --git a/packages/collector/__tests__/getProjectIssues.test.ts b/packages/collector/__tests__/getProjectIssues.test.ts index ec58fad28..a0076161f 100644 --- a/packages/collector/__tests__/getProjectIssues.test.ts +++ b/packages/collector/__tests__/getProjectIssues.test.ts @@ -7,7 +7,9 @@ describe("Working issue listing", () => { beforeEach(() => { nock("https://api.github.com") .get("/repos/OWNER/REPO/issues") - .query((actualQueryObject) => actualQueryObject.labels === "help-wanted") + .query( + (actualQueryObject) => actualQueryObject["labels"] === "help-wanted", + ) .reply(200, [ { body: "BODY_C", @@ -18,7 +20,9 @@ describe("Working issue listing", () => { ]); nock("https://api.github.com") .get("/repos/OWNER/REPO/issues") - .query((actualQueryObject) => actualQueryObject.labels === "help wanted") + .query( + (actualQueryObject) => actualQueryObject["labels"] === "help wanted", + ) .reply(200, [ { body: "BODY_I", @@ -99,7 +103,7 @@ test("getProjectIssues auto-populates body", async () => { nock("https://api.github.com") .get("/repos/OWNER/REPO/issues") - .query((actualQueryObject) => actualQueryObject.labels === "help-wanted") + .query((actualQueryObject) => actualQueryObject["labels"] === "help-wanted") .reply(200, [ { html_url: "https://example.test", number: 1, title: "CORRECT" }, ]); diff --git a/packages/collector/__tests__/setup.ts b/packages/collector/__tests__/setup.ts index 7af8df483..028fc8219 100644 --- a/packages/collector/__tests__/setup.ts +++ b/packages/collector/__tests__/setup.ts @@ -10,7 +10,7 @@ jest.mock("../src/octokit", () => { const OctokitWithRest = Octokit.plugin(restEndpointMethods); return { octokit: new OctokitWithRest({ - auth: process.env.PAT, + auth: process.env["PAT"], request: { fetch: nodeFetch, }, diff --git a/packages/collector/eslint.config.js b/packages/collector/eslint.config.js index 06b5c693f..af61d636a 100644 --- a/packages/collector/eslint.config.js +++ b/packages/collector/eslint.config.js @@ -207,6 +207,7 @@ export default tseslint.config( files: ["**/*.js"], rules: { "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", }, }, ); diff --git a/packages/collector/src/getProjectIssues.ts b/packages/collector/src/getProjectIssues.ts index 581e3da14..668df4272 100644 --- a/packages/collector/src/getProjectIssues.ts +++ b/packages/collector/src/getProjectIssues.ts @@ -22,7 +22,7 @@ export async function getProjectIssues( }); return issues.data.map((issue) => ({ description: issue.body ?? "", - link: publicRepo ? issue.html_url : undefined, + ...(publicRepo && { link: issue.html_url }), number: issue.number, title: issue.title, })); diff --git a/packages/collector/src/octokit.ts b/packages/collector/src/octokit.ts index cab269f88..d1601a788 100644 --- a/packages/collector/src/octokit.ts +++ b/packages/collector/src/octokit.ts @@ -3,4 +3,4 @@ import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods"; // eslint-disable-next-line @typescript-eslint/naming-convention -- Classes should be PascalCase const OctokitWithRest = Octokit.plugin(restEndpointMethods); -export const octokit = new OctokitWithRest({ auth: process.env.PAT }); +export const octokit = new OctokitWithRest({ auth: process.env["PAT"] }); diff --git a/packages/collector/tsconfig.json b/packages/collector/tsconfig.json index 371325d13..803f6eaa4 100644 --- a/packages/collector/tsconfig.json +++ b/packages/collector/tsconfig.json @@ -2,8 +2,14 @@ "compilerOptions": { "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "exactOptionalPropertyTypes": true, "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, "noUnusedLocals": true, "noUnusedParameters": true, "strict": true diff --git a/packages/frontend/__tests__/components/IssuesList.test.tsx b/packages/frontend/__tests__/components/IssuesList.test.tsx index bf1f074f0..9056a1693 100644 --- a/packages/frontend/__tests__/components/IssuesList.test.tsx +++ b/packages/frontend/__tests__/components/IssuesList.test.tsx @@ -20,8 +20,9 @@ describe("IssuesList component", () => { ({ - ...issue, - link: undefined, + description: issue.description, + number: issue.number, + title: issue.title, }))} project={project} /> diff --git a/packages/frontend/src/components/Issue.tsx b/packages/frontend/src/components/Issue.tsx index e439458ad..a9509dd4f 100644 --- a/packages/frontend/src/components/Issue.tsx +++ b/packages/frontend/src/components/Issue.tsx @@ -19,7 +19,7 @@ export const Issue = ({ subtitle={issue.project.name} subtitleDescription={issue.project["short-description"]} subtitleLink={getProjectLink(issue.project)} - tags={!hideTags ? issue.project.tags : []} + tags={!hideTags ? issue.project.tags ?? [] : []} title={issue.title} /> ); diff --git a/packages/frontend/src/components/Project.tsx b/packages/frontend/src/components/Project.tsx index 62c6279b4..8293ce897 100644 --- a/packages/frontend/src/components/Project.tsx +++ b/packages/frontend/src/components/Project.tsx @@ -13,7 +13,7 @@ export const Project = ({ ); diff --git a/packages/frontend/src/pages/IssueDetail.tsx b/packages/frontend/src/pages/IssueDetail.tsx index 319819fec..d401ed4b0 100644 --- a/packages/frontend/src/pages/IssueDetail.tsx +++ b/packages/frontend/src/pages/IssueDetail.tsx @@ -47,8 +47,8 @@ export const IssueDetail = ({ ); const projectIssues = getIssuesWithProjectInfo(data, { omitIssueNumber: issue?.number, - owner: projectOwner, - repo: projectRepo, + ...(projectOwner !== undefined && { owner: projectOwner }), + ...(projectRepo !== undefined && { repo: projectRepo }), }); if (!issue) { diff --git a/packages/frontend/src/utils/getAllIssues.ts b/packages/frontend/src/utils/getAllIssues.ts index 2fe0bee37..79c11280f 100644 --- a/packages/frontend/src/utils/getAllIssues.ts +++ b/packages/frontend/src/utils/getAllIssues.ts @@ -8,7 +8,7 @@ export interface ProjectIssueWithProjectInfo extends ProjectIssue { } interface Query extends Partial { - omitIssueNumber?: number; + omitIssueNumber: number | undefined; } export const getIssuesWithProjectInfo = ( diff --git a/packages/frontend/tsconfig.json b/packages/frontend/tsconfig.json index cf3f657df..7aad91d9d 100644 --- a/packages/frontend/tsconfig.json +++ b/packages/frontend/tsconfig.json @@ -1,17 +1,23 @@ { "compilerOptions": { - "module": "es2020", - "moduleResolution": "node", "allowSyntheticDefaultImports": true, "esModuleInterop": true, - "target": "es5", - "jsx": "react-jsx", "forceConsistentCasingInFileNames": true, + "jsx": "react-jsx", + "module": "es2020", + "moduleResolution": "node", + "sourceMap": true, + "target": "es5", + + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "exactOptionalPropertyTypes": true, "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, "noUnusedLocals": true, "noUnusedParameters": true, - "sourceMap": true, "strict": true } }