From a4f14d9a86292e283766ff67b66f18f8cb817fbf Mon Sep 17 00:00:00 2001
From: Jordan Eldredge
Date: Wed, 9 Jul 2025 20:52:57 -0700
Subject: [PATCH] Resolve lint errors
---
packages/skin-database/.eslintrc.js | 8 +++++++-
.../api/graphql/resolvers/ReviewResolver.ts | 1 -
packages/skin-database/app/(modern)/table/Table.tsx | 2 +-
packages/skin-database/cli.ts | 1 -
packages/skin-database/data/ArchiveFileModel.ts | 1 -
packages/skin-database/data/IaItemModel.ts | 1 -
packages/skin-database/data/TweetModel.ts | 1 -
packages/skin-database/data/skins.ts | 2 +-
.../skin-database/legacy-client/src/ReviewPage.js | 2 +-
.../legacy-client/src/components/Skin.js | 1 -
.../legacy-client/src/debug/DebugSkin.js | 2 +-
.../skin-database/legacy-client/src/redux/epics.js | 6 +++---
.../legacy-client/src/redux/selectors.js | 6 ++----
.../legacy-client/src/upload/uploadUtils.js | 2 +-
.../migrations/20220218192912_ia_metadata.ts | 2 +-
.../20220218195859_ai_metadata_timestamp.ts | 2 +-
packages/skin-database/services/openAi.ts | 13 -------------
packages/skin-database/tasks/tweetMilestones.ts | 1 -
18 files changed, 19 insertions(+), 35 deletions(-)
diff --git a/packages/skin-database/.eslintrc.js b/packages/skin-database/.eslintrc.js
index dc47f1fc..c408e0fa 100644
--- a/packages/skin-database/.eslintrc.js
+++ b/packages/skin-database/.eslintrc.js
@@ -18,7 +18,13 @@ module.exports = {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
- "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ {
+ argsIgnorePattern: "^_",
+ varsIgnorePattern: "^_",
+ },
+ ],
},
ignorePatterns: ["dist/**"],
};
diff --git a/packages/skin-database/api/graphql/resolvers/ReviewResolver.ts b/packages/skin-database/api/graphql/resolvers/ReviewResolver.ts
index a7a232a3..1af4fb75 100644
--- a/packages/skin-database/api/graphql/resolvers/ReviewResolver.ts
+++ b/packages/skin-database/api/graphql/resolvers/ReviewResolver.ts
@@ -1,4 +1,3 @@
-import { Ctx } from "..";
import UserContext from "../../../data/UserContext.js";
import { Rating, ReviewRow } from "../../../types";
import { ISkin } from "./CommonSkinResolver";
diff --git a/packages/skin-database/app/(modern)/table/Table.tsx b/packages/skin-database/app/(modern)/table/Table.tsx
index 6e4ef60e..da6d1d53 100644
--- a/packages/skin-database/app/(modern)/table/Table.tsx
+++ b/packages/skin-database/app/(modern)/table/Table.tsx
@@ -26,7 +26,7 @@ export default function WrappedTable({ initialSkins, skinCount }) {
}
function Table({ initialSkins, skinCount }) {
- const [skins, setSkins] = useState(initialSkins);
+ const skins = initialSkins;
const scale = 0.5; // This can be adjusted based on your needs
function getSkinData(data: {
diff --git a/packages/skin-database/cli.ts b/packages/skin-database/cli.ts
index aeb9f1f3..b381a87a 100755
--- a/packages/skin-database/cli.ts
+++ b/packages/skin-database/cli.ts
@@ -462,7 +462,6 @@ program
"missingModernSkins"
);
const missingModernSkinsSet = new Set(missingModernSkins);
- const skins = {};
for (const md5 of missingModernSkins!) {
const skin = await SkinModel.fromMd5(ctx, md5);
if (skin == null) {
diff --git a/packages/skin-database/data/ArchiveFileModel.ts b/packages/skin-database/data/ArchiveFileModel.ts
index 831591f5..7dfa905e 100644
--- a/packages/skin-database/data/ArchiveFileModel.ts
+++ b/packages/skin-database/data/ArchiveFileModel.ts
@@ -7,7 +7,6 @@ import FileInfoModel from "./FileInfoModel";
import { ISkin } from "../api/graphql/resolvers/CommonSkinResolver";
import SkinResolver from "../api/graphql/resolvers/SkinResolver";
import { Int } from "grats";
-import { Ctx } from "../api/graphql";
export type ArchiveFileDebugData = {
row: ArchiveFileRow;
diff --git a/packages/skin-database/data/IaItemModel.ts b/packages/skin-database/data/IaItemModel.ts
index e3bdf6a5..8164f99a 100644
--- a/packages/skin-database/data/IaItemModel.ts
+++ b/packages/skin-database/data/IaItemModel.ts
@@ -6,7 +6,6 @@ import { knex } from "../db";
import { fetchMetadata, fetchTasks } from "../services/internetArchive";
import { ISkin } from "../api/graphql/resolvers/CommonSkinResolver";
import SkinResolver from "../api/graphql/resolvers/SkinResolver";
-import { Ctx } from "../api/graphql";
const IA_URL = /^(https:\/\/)?archive.org\/details\/([^/]+)\/?/;
diff --git a/packages/skin-database/data/TweetModel.ts b/packages/skin-database/data/TweetModel.ts
index 1f7d57b1..c650786e 100644
--- a/packages/skin-database/data/TweetModel.ts
+++ b/packages/skin-database/data/TweetModel.ts
@@ -7,7 +7,6 @@ import SkinModel from "./SkinModel";
import { Int } from "grats";
import { ISkin } from "../api/graphql/resolvers/CommonSkinResolver";
import SkinResolver from "../api/graphql/resolvers/SkinResolver";
-import { Ctx } from "../api/graphql";
export type TweetDebugData = {
row: TweetRow;
diff --git a/packages/skin-database/data/skins.ts b/packages/skin-database/data/skins.ts
index d48b568d..c8be20df 100644
--- a/packages/skin-database/data/skins.ts
+++ b/packages/skin-database/data/skins.ts
@@ -1,4 +1,4 @@
-import { ALGOLIA_ACCOUNT, ALGOLIA_KEY, ALGOLIA_INDEX } from "../config";
+import { ALGOLIA_INDEX } from "../config";
import { knex } from "../db";
import path from "path";
import md5Hash from "md5";
diff --git a/packages/skin-database/legacy-client/src/ReviewPage.js b/packages/skin-database/legacy-client/src/ReviewPage.js
index 8266eff2..c567f2d2 100644
--- a/packages/skin-database/legacy-client/src/ReviewPage.js
+++ b/packages/skin-database/legacy-client/src/ReviewPage.js
@@ -163,7 +163,7 @@ export default function ReviewPage() {
Press up arrow to approve, down arrow to reject or "n" to mark as
NSFW.
- {reverseSkins.map((skin) => {
+ {reverseSkins.map((_skin) => {
return FIXME: Add TinderCard here
;
// return (
// No Tweets
) : (
- {skin.tweets.map((tweet, i) => (
+ {skin.tweets.map((tweet) => (
-
Tweet ({tweet.retweets} retweets /{" "}
{tweet.likes} likes)
diff --git a/packages/skin-database/legacy-client/src/redux/epics.js b/packages/skin-database/legacy-client/src/redux/epics.js
index 5dabb5d9..128225d8 100644
--- a/packages/skin-database/legacy-client/src/redux/epics.js
+++ b/packages/skin-database/legacy-client/src/redux/epics.js
@@ -94,7 +94,7 @@ const selectedSkinEpic = (actions) =>
const loadedSkinZipEpic = (actions) =>
actions.pipe(
filter((action) => action.type === "LOADED_SKIN_ZIP"),
- switchMap((action) => {
+ switchMap((_action) => {
// If a file is focused, but not yet loaded, try to load it now?
return EMPTY;
})
@@ -170,7 +170,7 @@ const searchEpic = (actions) =>
}));
return Actions.gotNewMatchingSkins(matchingSkins);
}),
- catchError((e) => {
+ catchError((_e) => {
return of(Actions.gotSearchError());
})
);
@@ -198,7 +198,7 @@ const alertEpic = (actions) =>
const chunkState = {};
-const unloadedSkinEpic = (actions, states) =>
+const unloadedSkinEpic = (actions, _states) =>
actions.pipe(
filter((action) => action.type === "REQUEST_UNLOADED_SKIN"),
map(({ index }) => {
diff --git a/packages/skin-database/legacy-client/src/redux/selectors.js b/packages/skin-database/legacy-client/src/redux/selectors.js
index b5885f5e..33bdfdd1 100644
--- a/packages/skin-database/legacy-client/src/redux/selectors.js
+++ b/packages/skin-database/legacy-client/src/redux/selectors.js
@@ -156,7 +156,6 @@ export const getRouteData = createSelector(
getFocusedSkinFile,
getPermalinkUrlFromHashGetter,
getSelectedSkinData,
- getDebugViewOpen,
(
activeContentPage,
hash,
@@ -164,8 +163,7 @@ export const getRouteData = createSelector(
fileExplorerOpen,
focusedSkinFile,
getPermalinkUrlFromHash,
- skinData,
- debugViewOpen
+ skinData
) => {
if (activeContentPage === REVIEW_PAGE) {
return { url: "/review/", title: "Review" };
@@ -229,7 +227,7 @@ export function getSkins(state) {
return state.skins;
}
-export function getFileExplorerOpen(state) {
+export function getFileExplorerOpen(_state) {
// The UI for this is not done yet.
// return state.fileExplorerOpen;
return false;
diff --git a/packages/skin-database/legacy-client/src/upload/uploadUtils.js b/packages/skin-database/legacy-client/src/upload/uploadUtils.js
index 755901a3..aae91518 100644
--- a/packages/skin-database/legacy-client/src/upload/uploadUtils.js
+++ b/packages/skin-database/legacy-client/src/upload/uploadUtils.js
@@ -22,7 +22,7 @@ export async function upload(fileObj) {
console.warn(
`Request to ${uploadUrl} returned 503, going to retry again in 5 seconds. ${retries} retries left...`
);
- await new Promise((resolve) => setTimeout((resolve) => 5000));
+ await new Promise((resolve) => setTimeout(resolve, 5000));
continue;
}
diff --git a/packages/skin-database/migrations/20220218192912_ia_metadata.ts b/packages/skin-database/migrations/20220218192912_ia_metadata.ts
index 020e8911..2db05fc6 100644
--- a/packages/skin-database/migrations/20220218192912_ia_metadata.ts
+++ b/packages/skin-database/migrations/20220218192912_ia_metadata.ts
@@ -4,6 +4,6 @@ export async function up(knex: knex): Promise {
await knex.raw(`ALTER TABLE ia_items ADD COLUMN metadata;`);
}
-export async function down(knex: knex): Promise {
+export async function down(_knex: knex): Promise {
throw new Error("I never implemented a down migration for adding metadata.");
}
diff --git a/packages/skin-database/migrations/20220218195859_ai_metadata_timestamp.ts b/packages/skin-database/migrations/20220218195859_ai_metadata_timestamp.ts
index 45f6aaf4..325bb94e 100644
--- a/packages/skin-database/migrations/20220218195859_ai_metadata_timestamp.ts
+++ b/packages/skin-database/migrations/20220218195859_ai_metadata_timestamp.ts
@@ -4,7 +4,7 @@ export async function up(knex: knex): Promise {
await knex.raw(`ALTER TABLE ia_items ADD COLUMN metadata_timestamp;`);
}
-export async function down(knex: knex): Promise {
+export async function down(_knex: knex): Promise {
throw new Error(
"I never implemented a down migration for adding metadata_timestamp."
);
diff --git a/packages/skin-database/services/openAi.ts b/packages/skin-database/services/openAi.ts
index 19c097c7..7ebaba0c 100644
--- a/packages/skin-database/services/openAi.ts
+++ b/packages/skin-database/services/openAi.ts
@@ -1,4 +1,3 @@
-import fs from "node:fs";
import SkinModel from "../data/SkinModel.js";
import OpenAI from "openai";
@@ -6,18 +5,6 @@ const client = new OpenAI({
apiKey: process.env["OPENAI_API_KEY"], // This is the default and can be omitted
});
-const prompt = `
-You are a digital preservationist being presented with a screenshot of a Winamp
-skin. Write a short description of the skin which can be used to index the skin
-for search retrieval.
-
-Do not describe any features which are common to all Winamp skins, such as the
-set of UI elements visible.
-
-The description should be concise and descriptive, and should not include any
-personal opinions or judgement. The description should be written in English and
-should be no longer than 200 characters.`;
-
const prompt2 = `You are a staff digital preservationist working at the Internet Archive.
You have been tasked with identifying a comma separated list of tags for a Winamp skin to
be used for indexing purposes. Ignore the names of the tracks in the playlist.`;
diff --git a/packages/skin-database/tasks/tweetMilestones.ts b/packages/skin-database/tasks/tweetMilestones.ts
index f30e29f1..cefb52a8 100644
--- a/packages/skin-database/tasks/tweetMilestones.ts
+++ b/packages/skin-database/tasks/tweetMilestones.ts
@@ -1,5 +1,4 @@
import { getTwitterClient } from "../twitter";
-import fs from "fs";
import DiscordEventHandler from "../api/DiscordEventHandler";
import KeyValue from "../data/KeyValue";