* Fix lints

* Fix typechecking
This commit is contained in:
Jordan Eldredge 2025-12-15 22:12:14 -08:00 committed by GitHub
parent 1f875a6155
commit 50a7c2df49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 20 additions and 14 deletions

View file

@ -7,4 +7,3 @@ export type Ctx = Express.Request;
export function getUserContext(ctx: Ctx): UserContext {
return ctx.ctx;
}

View file

@ -1,7 +1,6 @@
import { ISkin } from "./CommonSkinResolver";
import { NodeResolver, toId } from "./NodeResolver";
import ReviewResolver from "./ReviewResolver";
import path from "path";
import { ID, Int } from "grats";
import SkinModel from "../../../data/SkinModel";

View file

@ -1,5 +1,6 @@
"use client";
// @ts-expect-error - unstable_ViewTransition is not yet in @types/react
import { unstable_ViewTransition as ViewTransition } from "react";
import { ClientSkin } from "./SkinScroller";
import SkinActionIcons from "./SkinActionIcons";

View file

@ -4,6 +4,7 @@ import React, {
useMemo,
useCallback,
useRef,
// @ts-expect-error - unstable_ViewTransition is not yet in @types/react
unstable_ViewTransition as ViewTransition,
} from "react";
@ -141,7 +142,7 @@ export default function SkinTable({
return skin ? skin.md5 : `empty-cell-${columnIndex}-${rowIndex}`;
}
const gridRef = React.useRef<any>();
const gridRef = React.useRef<any>(null);
const itemRef = React.useRef<number>(0);
const onScroll = useMemo(() => {

View file

@ -111,8 +111,8 @@ function SkinTableUnbound({
}
return skin ? skin.hash : `unfectched-index-${requestToken}`;
}
const gridRef = React.useRef();
const itemRef = React.useRef();
const gridRef = React.useRef<any>(null);
const itemRef = React.useRef<number>(0);
React.useLayoutEffect(() => {
if (gridRef.current == null) {
return;

View file

@ -225,7 +225,9 @@ async function main(): Promise<void> {
// Wait for the service to start
log("→ Waiting for service to be ready...", "cyan");
await new Promise((resolve) => setTimeout(resolve, 5000));
await new Promise((resolve) => {
setTimeout(resolve, 5000);
});
// Check if the service is running
const pm2List = execSilent("pm2 list");

View file

@ -22,7 +22,7 @@ export async function fetchMetadata(identifier: string): Promise<any> {
}
export async function fetchTasks(identifier: string): Promise<any> {
const result = await execFile(IA_COMMAND, ['tasks', identifier], {
const result = await execFile(IA_COMMAND, ["tasks", identifier], {
env: getVenvEnv(),
});
return result.stdout
@ -35,7 +35,7 @@ export async function uploadFile(
identifier: string,
filepath: string
): Promise<any> {
await execFile(IA_COMMAND, ['upload', identifier, filepath], {
await execFile(IA_COMMAND, ["upload", identifier, filepath], {
env: getVenvEnv(),
});
}
@ -45,19 +45,19 @@ export async function uploadFiles(
filepaths: string[],
metadata?: { [key: string]: string }
): Promise<any> {
const args = ['upload', identifier, ...filepaths];
const args = ["upload", identifier, ...filepaths];
if (metadata) {
Object.entries(metadata).forEach(([key, value]) => {
args.push(`--metadata=${key}:${value}`);
});
}
await execFile(IA_COMMAND, args, { env: getVenvEnv() });
}
export async function identifierExists(identifier: string): Promise<boolean> {
const result = await execFile(IA_COMMAND, ['metadata', identifier], {
const result = await execFile(IA_COMMAND, ["metadata", identifier], {
env: getVenvEnv(),
});
const data = JSON.parse(result.stdout);
@ -69,6 +69,10 @@ export async function setMetadata(
data: { [key: string]: string }
) {
const pairs = Object.entries(data).map(([key, value]) => `${key}:${value}`);
const args = ['metadata', identifier, ...pairs.map((pair) => `--modify=${pair}`)];
const args = [
"metadata",
identifier,
...pairs.map((pair) => `--modify=${pair}`),
];
await execFile(IA_COMMAND, args, { env: getVenvEnv() });
}

View file

@ -8,7 +8,7 @@ import SkinModel from "../data/SkinModel";
import * as Parallel from "async-parallel";
import IaItemModel from "../data/IaItemModel";
import DiscordEventHandler from "../api/DiscordEventHandler";
import { exec, execFile } from "../utils";
import { execFile } from "../utils";
import * as IAService from "../services/internetArchive";
export async function findItemsMissingImages(): Promise<string[]> {