From 32c895e150cae6cc0079274018a957df2bd6061a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20G=C3=B3mez?= Date: Mon, 22 Dec 2025 13:25:38 +0100 Subject: [PATCH] chore: lint fix --- src/components/KindRenderer.tsx | 10 +++++----- src/hooks/useStable.ts | 5 +---- src/lib/nostr-kinds.ts | 17 +++++++++++------ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/KindRenderer.tsx b/src/components/KindRenderer.tsx index da229ba..5ede7a4 100644 --- a/src/components/KindRenderer.tsx +++ b/src/components/KindRenderer.tsx @@ -84,11 +84,11 @@ export default function KindRenderer({ kind }: { kind: number }) { : "Stored by relays"} {isParameterizedReplaceableKind(kind) && ( - <> -
Identifier
- d-tag - - )} + <> +
Identifier
+ d-tag + + )} {kindInfo.nip && ( <>
Defined in
diff --git a/src/hooks/useStable.ts b/src/hooks/useStable.ts index 1ddb430..29610e2 100644 --- a/src/hooks/useStable.ts +++ b/src/hooks/useStable.ts @@ -18,10 +18,7 @@ import { useMemo } from "react"; * const stableFilters = useStableValue(filters); * ``` */ -export function useStableValue( - value: T, - serialize?: (v: T) => string -): T { +export function useStableValue(value: T, serialize?: (v: T) => string): T { const serialized = serialize?.(value) ?? JSON.stringify(value); // eslint-disable-next-line react-hooks/exhaustive-deps return useMemo(() => value, [serialized]); diff --git a/src/lib/nostr-kinds.ts b/src/lib/nostr-kinds.ts index 126ee26..7b348e7 100644 --- a/src/lib/nostr-kinds.ts +++ b/src/lib/nostr-kinds.ts @@ -45,7 +45,10 @@ export const PARAMETERIZED_REPLACEABLE_END = 40000; // exclusive: parameterized * for consistency with NIP-01 terminology */ export function isParameterizedReplaceableKind(kind: number): boolean { - return kind >= PARAMETERIZED_REPLACEABLE_START && kind < PARAMETERIZED_REPLACEABLE_END; + return ( + kind >= PARAMETERIZED_REPLACEABLE_START && + kind < PARAMETERIZED_REPLACEABLE_END + ); } /** @@ -64,9 +67,11 @@ export function isAddressableKind(kind: number): boolean { /** * Get the category of a kind for display purposes */ -export function getKindCategory(kind: number): 'regular' | 'replaceable' | 'ephemeral' | 'parameterized_replaceable' { - if (_isReplaceableKind(kind)) return 'replaceable'; - if (_isEphemeralKind(kind)) return 'ephemeral'; - if (isParameterizedReplaceableKind(kind)) return 'parameterized_replaceable'; - return 'regular'; +export function getKindCategory( + kind: number, +): "regular" | "replaceable" | "ephemeral" | "parameterized_replaceable" { + if (_isReplaceableKind(kind)) return "replaceable"; + if (_isEphemeralKind(kind)) return "ephemeral"; + if (isParameterizedReplaceableKind(kind)) return "parameterized_replaceable"; + return "regular"; }