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.
This commit is contained in:
Alex Gleason committed 2026-04-26 21:42:33 -05:00
1 parent b868c445d5
commit ae0a857299
2 files changed
+10 -9

No files matched your search

+9 -2
View File
@@ -5,12 +5,19 @@ import { useCurrentUser } from "./useCurrentUser";
import type { NostrEvent } from "@nostrify/nostrify";
export function useNostrPublish(): UseMutationResult<NostrEvent> {
type EventTemplate = Pick<NostrEvent, 'kind' | 'content'> &
Partial<Pick<NostrEvent, 'tags' | 'created_at'>>;
export function useNostrPublish(): UseMutationResult<
NostrEvent,
Error,
EventTemplate
> {
const { nostr } = useNostr();
const { user } = useCurrentUser();
return useMutation({
mutationFn: async (t: Omit<NostrEvent, 'id' | 'pubkey' | 'sig'>) => {
mutationFn: async (t: EventTemplate) => {
if (user) {
const tags = t.tags ?? [];
+1 -7
View File
@@ -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/*"]
}