Progmasoft Git

progmaweb

The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.

Clonegit clone https://git.progmasoft.com/progmaweb

Declare the props of the git pages as interfaces

Codacy (consistent-type-definitions) asks for an interface where an object
type is declared.
Commit
c32d79b7b47393a62a1414851de49907c4c7b9bf
Author
Leitwolf11 ·
Parents
1228332e2584

Files · Download .tar.gz

Changes

 apps/web/app/git/[repo]/commit/[sha]/page.tsx | 4 +++-
 apps/web/app/git/params.ts                    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/apps/web/app/git/[repo]/commit/[sha]/page.tsx b/apps/web/app/git/[repo]/commit/[sha]/page.tsx
index e7bec78..48cfd49 100644
--- a/apps/web/app/git/[repo]/commit/[sha]/page.tsx
+++ b/apps/web/app/git/[repo]/commit/[sha]/page.tsx
@@ -8,7 +8,9 @@ import { gitCommit, gitRepository } from "@/lib/git.server";
 import { getLocale } from "@/lib/locale.server";
 import { GitFrame, gitDate, gitHref } from "../../../GitFrame";
 
-type Props = { params: Promise<{ repo: string; sha: string }> };
+interface Props {
+  params: Promise<{ repo: string; sha: string }>;
+}
 
 export async function generateMetadata({ params }: Props): Promise<Metadata> {
   const { repo, sha } = await params;
diff --git a/apps/web/app/git/params.ts b/apps/web/app/git/params.ts
index f130fe2..5056168 100644
--- a/apps/web/app/git/params.ts
+++ b/apps/web/app/git/params.ts
@@ -2,10 +2,10 @@
 // SPDX-License-Identifier: AGPL-3.0-or-later
 
 /** The parameters of a repository page. */
-export type RepositoryProps = {
+export interface RepositoryProps {
   params: Promise<{ repo: string }>;
   searchParams: Promise<Record<string, string | string[] | undefined>>;
-};
+}
 
 /** One query parameter as text; the first when it is given more than once. */
 export function one(