From ae0a857299b14294c29344e94d3273b793a5adea Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 26 Apr 2026 21:42:33 -0500 Subject: [PATCH] Enable TypeScript strict mode and drop deprecated baseUrl tsconfig: remove the deprecated `baseUrl` (paths already use relative `./src/*`), flip strict to true, and drop the now-redundant individual linting flags that were only there to partially relax the old non-strict config. useNostrPublish: tighten the mutation input type to a proper EventTemplate (Pick kind+content, Partial tags+created_at) so its UseMutationResult generics match the call sites under strict mode. --- src/hooks/useNostrPublish.ts | 11 +++++++++-- tsconfig.json | 8 +------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/hooks/useNostrPublish.ts b/src/hooks/useNostrPublish.ts index b9a3bc2..f5d9c02 100644 --- a/src/hooks/useNostrPublish.ts +++ b/src/hooks/useNostrPublish.ts @@ -5,12 +5,19 @@ import { useCurrentUser } from "./useCurrentUser"; import type { NostrEvent } from "@nostrify/nostrify"; -export function useNostrPublish(): UseMutationResult { +type EventTemplate = Pick & + Partial>; + +export function useNostrPublish(): UseMutationResult< + NostrEvent, + Error, + EventTemplate +> { const { nostr } = useNostr(); const { user } = useCurrentUser(); return useMutation({ - mutationFn: async (t: Omit) => { + mutationFn: async (t: EventTemplate) => { if (user) { const tags = t.tags ?? []; diff --git a/tsconfig.json b/tsconfig.json index a7596da..70b8913 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,14 +15,8 @@ "jsx": "react-jsx", /* Linting */ - "strict": false, - "strictNullChecks": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "noImplicitAny": false, - "noFallthroughCasesInSwitch": false, + "strict": true, - "baseUrl": ".", "paths": { "@/*": ["./src/*"] }