From 8525c8e2c64a8f5d25cf234412c16aa8154c5baa Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Thu, 31 Oct 2024 15:56:15 +0100 Subject: [PATCH] fix: lint issues --- .../[locale]/manage/users/groups/[id]/_rename-group-form.tsx | 2 +- .../users/groups/[id]/permissions/_group-permission-form.tsx | 4 +--- apps/nextjs/src/versions/package-reader.ts | 2 +- packages/server-settings/src/index.ts | 4 +--- packages/widgets/src/import.ts | 4 +--- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/_rename-group-form.tsx b/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/_rename-group-form.tsx index 5f71808d4..407ee2429 100644 --- a/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/_rename-group-form.tsx +++ b/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/_rename-group-form.tsx @@ -58,7 +58,7 @@ export const RenameGroupForm = ({ group, disabled }: RenameGroupFormProps) => { }, ); }, - [group.id, mutate, t], + [group.id, mutate, t, disabled], ); return ( diff --git a/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/permissions/_group-permission-form.tsx b/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/permissions/_group-permission-form.tsx index ef5906354..bcf0d3639 100644 --- a/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/permissions/_group-permission-form.tsx +++ b/apps/nextjs/src/app/[locale]/manage/users/groups/[id]/permissions/_group-permission-form.tsx @@ -45,9 +45,7 @@ export const PermissionForm = ({ children, initialPermissions }: PropsWithChildr ); }; -type FormType = { - [key in GroupPermissionKey]: boolean; -}; +type FormType = Record; export const PermissionSwitch = ({ name }: { name: GroupPermissionKey }) => { const form = useFormContext(); diff --git a/apps/nextjs/src/versions/package-reader.ts b/apps/nextjs/src/versions/package-reader.ts index c61da286b..25976619e 100644 --- a/apps/nextjs/src/versions/package-reader.ts +++ b/apps/nextjs/src/versions/package-reader.ts @@ -29,7 +29,7 @@ export const getPackageAttributesAsync = async () => { }; }; -type PackageJsonDependencies = { [key in string]: string }; +type PackageJsonDependencies = Record; interface PackageJson { dependencies: PackageJsonDependencies | undefined; } diff --git a/packages/server-settings/src/index.ts b/packages/server-settings/src/index.ts index ee5a6ade8..7934dc0da 100644 --- a/packages/server-settings/src/index.ts +++ b/packages/server-settings/src/index.ts @@ -1,8 +1,6 @@ export const defaultServerSettingsKeys = ["analytics", "crawlingAndIndexing"] as const; -export type ServerSettingsRecord = { - [key in (typeof defaultServerSettingsKeys)[number]]: Record; -}; +export type ServerSettingsRecord = Record<(typeof defaultServerSettingsKeys)[number], Record>; export const defaultServerSettings = { analytics: { diff --git a/packages/widgets/src/import.ts b/packages/widgets/src/import.ts index 2868bb32e..911871a38 100644 --- a/packages/widgets/src/import.ts +++ b/packages/widgets/src/import.ts @@ -1,5 +1,3 @@ import type { WidgetKind } from "@homarr/definitions"; -export type WidgetImportRecord = { - [K in WidgetKind]: unknown; -}; +export type WidgetImportRecord = Record;