From fe69b27c1c8f7aa5a26f37859f917e389d1592d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Thu, 12 Sep 2024 15:08:45 +0300 Subject: [PATCH 1/2] [frontend] Stricter tsconfig --- packages/frontend/tsconfig.json | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/frontend/tsconfig.json b/packages/frontend/tsconfig.json index cf3f657df..f708dc335 100644 --- a/packages/frontend/tsconfig.json +++ b/packages/frontend/tsconfig.json @@ -1,17 +1,25 @@ { "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", + + "skipLibCheck": true, + + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "exactOptionalPropertyTypes": true, "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, "noUnusedLocals": true, "noUnusedParameters": true, - "sourceMap": true, "strict": true } } From a423e19e724c4b4b46d61a3ca51ceb87b8bc3167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Thu, 12 Sep 2024 15:40:09 +0300 Subject: [PATCH 2/2] [frontend] Fixed confusing optional properties --- packages/frontend/__tests__/components/IssuesList.test.tsx | 5 +++-- packages/frontend/src/components/Issue.tsx | 2 +- packages/frontend/src/components/Project.tsx | 2 +- packages/frontend/src/pages/IssueDetail.tsx | 4 ++-- packages/frontend/src/utils/getAllIssues.ts | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) 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..a98364e7a 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 = (