mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
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:
2 files changed
+10
-9
No files matched your search
@@ -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 ?? [];
|
||||
|
||||
|
||||
Reference in new issue
Block a user