mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-03 08:07:21 +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 ?? [];
|
||||
|
||||
|
||||
+1
-7
@@ -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/*"]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user