mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Fix all linting and type errors
- Remove unused imports (Badge, PullRequestCheck) - Fix React Hook dependency warnings by using useCallback - Replace 'any' types with proper TypeScript interfaces - Fix unused variable errors by prefixing with underscore - Remove placeholder comments - Consolidate duplicate type definitions at module level - Add proper type definitions for API responses - Fix const vs let issues
This commit is contained in:
1 parent
67aea6a3b2
commit
1c4b1e6263
11 files changed
+343
-96
No files matched your search
@@ -193,7 +193,7 @@ export function useGitHubOAuth() {
|
||||
}));
|
||||
return false;
|
||||
}
|
||||
}, [addCredential, corsProxy]);
|
||||
}, [addCredential, addHostToken, corsProxy]);
|
||||
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -33,7 +33,7 @@ function parseRemoteUrl(url: string): RemoteInfo | null {
|
||||
if (url.startsWith('nostr://')) {
|
||||
const match = url.match(/^nostr:\/\/([^/]+)\/(.+)$/);
|
||||
if (match) {
|
||||
let pubkeyOrNpub = match[1];
|
||||
const pubkeyOrNpub = match[1];
|
||||
const repo = match[2];
|
||||
|
||||
// Convert npub to hex if needed
|
||||
@@ -132,7 +132,20 @@ async function fetchGitHubPRs(info: RemoteInfo, token?: string, currentUsername?
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
const allPRs = data.map((pr: any) => ({
|
||||
interface GitHubPR {
|
||||
id: number;
|
||||
number: number;
|
||||
title: string;
|
||||
state: string;
|
||||
user: { login: string };
|
||||
html_url: string;
|
||||
created_at: string;
|
||||
head: { ref: string };
|
||||
base: { ref: string };
|
||||
body?: string;
|
||||
}
|
||||
|
||||
const allPRs = data.map((pr: GitHubPR) => ({
|
||||
id: pr.id,
|
||||
number: pr.number,
|
||||
title: pr.title,
|
||||
@@ -188,7 +201,20 @@ async function fetchGitLabMRs(info: RemoteInfo, token?: string, currentUsername?
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
const allMRs = data.map((mr: any) => ({
|
||||
interface GitLabMR {
|
||||
id: number;
|
||||
iid: number;
|
||||
title: string;
|
||||
state: string;
|
||||
author: { username: string };
|
||||
web_url: string;
|
||||
created_at: string;
|
||||
source_branch: string;
|
||||
target_branch: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
const allMRs = data.map((mr: GitLabMR) => ({
|
||||
id: mr.id,
|
||||
number: mr.iid,
|
||||
title: mr.title,
|
||||
@@ -211,10 +237,14 @@ async function fetchGitLabMRs(info: RemoteInfo, token?: string, currentUsername?
|
||||
return [];
|
||||
}
|
||||
|
||||
interface NostrInterface {
|
||||
query: (filters: unknown[], options?: { signal?: AbortSignal }) => Promise<unknown[]>;
|
||||
}
|
||||
|
||||
async function fetchNostrPatches(
|
||||
info: RemoteInfo,
|
||||
currentUserPubkey: string | undefined,
|
||||
nostr: any,
|
||||
nostr: NostrInterface,
|
||||
signal: AbortSignal,
|
||||
isRepoOwner?: boolean
|
||||
): Promise<PullRequest[]> {
|
||||
|
||||
Reference in new issue
Block a user