Resolve lint errors

This commit is contained in:
Jordan Eldredge 2025-07-09 20:52:57 -07:00
parent 4ead993d64
commit a4f14d9a86
18 changed files with 19 additions and 35 deletions

View file

@ -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/**"],
};

View file

@ -1,4 +1,3 @@
import { Ctx } from "..";
import UserContext from "../../../data/UserContext.js";
import { Rating, ReviewRow } from "../../../types";
import { ISkin } from "./CommonSkinResolver";

View file

@ -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: {

View file

@ -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) {

View file

@ -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;

View file

@ -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\/([^/]+)\/?/;

View file

@ -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;

View file

@ -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";

View file

@ -163,7 +163,7 @@ export default function ReviewPage() {
Press up arrow to approve, down arrow to reject or "n" to mark as
NSFW.
</p>
{reverseSkins.map((skin) => {
{reverseSkins.map((_skin) => {
return <div>FIXME: Add TinderCard here</div>;
// return (
// <TinderCard

View file

@ -7,7 +7,6 @@ function Skin({
style,
height,
width,
color,
selectSkin,
hash,
permalink,

View file

@ -109,7 +109,7 @@ export default function DebugSkin({ md5 }) {
<p>No Tweets</p>
) : (
<ul>
{skin.tweets.map((tweet, i) => (
{skin.tweets.map((tweet) => (
<li key={tweet.url}>
<a href={tweet.url}>Tweet</a> ({tweet.retweets} retweets /{" "}
{tweet.likes} likes)

View file

@ -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 }) => {

View file

@ -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;

View file

@ -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;
}

View file

@ -4,6 +4,6 @@ export async function up(knex: knex): Promise<any> {
await knex.raw(`ALTER TABLE ia_items ADD COLUMN metadata;`);
}
export async function down(knex: knex): Promise<any> {
export async function down(_knex: knex): Promise<any> {
throw new Error("I never implemented a down migration for adding metadata.");
}

View file

@ -4,7 +4,7 @@ export async function up(knex: knex): Promise<any> {
await knex.raw(`ALTER TABLE ia_items ADD COLUMN metadata_timestamp;`);
}
export async function down(knex: knex): Promise<any> {
export async function down(_knex: knex): Promise<any> {
throw new Error(
"I never implemented a down migration for adding metadata_timestamp."
);

View file

@ -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.`;

View file

@ -1,5 +1,4 @@
import { getTwitterClient } from "../twitter";
import fs from "fs";
import DiscordEventHandler from "../api/DiscordEventHandler";
import KeyValue from "../data/KeyValue";