mirror of
https://github.com/dergigi/boris.git
synced 2026-01-22 00:04:30 +01:00
fix: resolve all linting and TypeScript issues
- Set up comprehensive ESLint configuration with TypeScript support - Fix React import issues by adding explicit React imports - Replace 'any' types with proper TypeScript types (unknown, specific interfaces) - Add proper type definitions for addressLoader function signature - Make relays parameter optional in addressLoader interface - Fix TypeScript strict null checks and function call signatures - Ensure all code passes ESLint with zero warnings - Verify TypeScript compilation with no errors - Maintain strict linting rules without reducing code quality All linting and type checking now passes successfully.
This commit is contained in:
@@ -4,6 +4,7 @@ import { EventStore } from 'applesauce-core'
|
||||
import { AccountManager } from 'applesauce-accounts'
|
||||
import { RelayPool } from 'applesauce-relay'
|
||||
import { Loaders } from 'applesauce-loaders'
|
||||
import { NostrEvent } from 'nostr-tools'
|
||||
import Login from './components/Login'
|
||||
import Bookmarks from './components/Bookmarks'
|
||||
|
||||
@@ -11,7 +12,13 @@ function App() {
|
||||
const [eventStore, setEventStore] = useState<EventStore | null>(null)
|
||||
const [accountManager, setAccountManager] = useState<AccountManager | null>(null)
|
||||
const [relayPool, setRelayPool] = useState<RelayPool | null>(null)
|
||||
const [addressLoader, setAddressLoader] = useState<any>(null)
|
||||
const [addressLoader, setAddressLoader] = useState<((params: { kind: number; pubkey: string; relays?: string[] }) => {
|
||||
subscribe: (observer: {
|
||||
next: (event: NostrEvent) => void;
|
||||
error: (error: unknown) => void;
|
||||
complete: () => void;
|
||||
}) => { unsubscribe: () => void };
|
||||
}) | null>(null)
|
||||
const [isAuthenticated, setIsAuthenticated] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { Hooks } from 'applesauce-react'
|
||||
import { NostrEvent } from 'nostr-tools'
|
||||
|
||||
@@ -12,7 +12,13 @@ interface Bookmark {
|
||||
}
|
||||
|
||||
interface BookmarksProps {
|
||||
addressLoader: any
|
||||
addressLoader: ((params: { kind: number; pubkey: string; relays?: string[] }) => {
|
||||
subscribe: (observer: {
|
||||
next: (event: NostrEvent) => void;
|
||||
error: (error: unknown) => void;
|
||||
complete: () => void;
|
||||
}) => { unsubscribe: () => void };
|
||||
}) | null
|
||||
onLogout: () => void
|
||||
}
|
||||
|
||||
@@ -49,7 +55,7 @@ const Bookmarks: React.FC<BookmarksProps> = ({ addressLoader, onLogout }) => {
|
||||
bookmarkList.push(bookmarkData)
|
||||
}
|
||||
},
|
||||
error: (error: any) => {
|
||||
error: (error: unknown) => {
|
||||
console.error('Error fetching bookmarks:', error)
|
||||
setLoading(false)
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { Hooks } from 'applesauce-react'
|
||||
import { Accounts } from 'applesauce-accounts'
|
||||
|
||||
|
||||
4
src/types/nostr.d.ts
vendored
4
src/types/nostr.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
nostr?: {
|
||||
getPublicKey(): Promise<string>
|
||||
signEvent(event: any): Promise<any>
|
||||
getPublicKey(): Promise<string>
|
||||
signEvent(event: unknown): Promise<unknown>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user