chore: fix various eslint warnings

This commit is contained in:
Christian Benincasa
2025-10-02 07:29:25 -04:00
parent e98cccb94d
commit b604a6dfbb
14 changed files with 18 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ import tseslint, { parser } from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'eslint.config.js',
'**/.tsup/*',
'**/dist/*',
'**/build/*',
@@ -18,7 +19,10 @@ export default tseslint.config(
'**/*.ignore.ts',
'**/*.test.ts', // Ignore test files for now, until we fix up tsconfig files
'**/generated/*', // Ignore all generated code
'server/esbuild/*',
'server/src/web/*',
'server/src/testing/*',
'server/cjs-shim.ts',
'release.config.mjs',
],
},

View File

@@ -1,3 +1,4 @@
/* eslint-disable */
import { createRequire } from 'node:module';
import path from 'node:path';
import url from 'node:url';
@@ -5,3 +6,4 @@ import url from 'node:url';
globalThis.require = createRequire(import.meta.url);
globalThis.__filename = url.fileURLToPath(import.meta.url);
globalThis.__dirname = path.dirname(__filename);
/* eslint-enable */

View File

@@ -16,6 +16,7 @@
"debug": "dotenv -e .env.development -- tsx watch --trace-warnings --tsconfig ./tsconfig.build.json --ignore 'src/streams' --inspect-wait ./src",
"dev": "dotenv -e .env.development -- tsx watch --trace-warnings --tsconfig ./tsconfig.build.json --ignore 'build' --ignore 'src/streams' --ignore 'src/**/*.test.ts' ./src/index.ts",
"generate-openapi": "tsx src/index.ts generate-openapi",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"kysely": "dotenv -e .env.development -- kysely",
"make-bin": "dotenv -- tsx scripts/make-bin.ts",
"preinstall": "npx only-allow pnpm",

View File

@@ -10,8 +10,6 @@ import fastify, { FastifySchema } from 'fastify';
import fastifyGracefulShutdown from 'fastify-graceful-shutdown';
import fp from 'fastify-plugin';
import fastifyPrintRoutes from 'fastify-print-routes';
import fs from 'node:fs/promises';
import type { ZodTypeProvider } from 'fastify-type-provider-zod';
import {
jsonSchemaTransform,
@@ -30,6 +28,7 @@ import {
values,
} from 'lodash-es';
import schedule from 'node-schedule';
import fs from 'node:fs/promises';
import path, { dirname } from 'node:path';
import 'reflect-metadata';
import { z } from 'zod/v4';

View File

@@ -74,7 +74,6 @@ export class SchemaBackedDbAdapter<T extends z.ZodTypeAny>
}
// eslint can't seem to handle this but TS compiler gets it right.
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return parseResult.data;
}

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
import type { Nullable } from '@/types/util.js';
import { isProduction } from '@/util/index.js';
import { LoggerFactory } from '@/util/logging/LoggerFactory.js';

View File

@@ -1,11 +1,12 @@
import { Channel } from '../src/db/entities/Channel.ts';
import type { Channel } from '../src/db/entities/Channel.ts';
interface CustomMatchers<R = unknown> {
toMatchChannel: (channel: Channel) => R;
}
declare module 'vitest' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
interface Assertion<T = any> extends CustomMatchers<T> {}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface AsymmetricMatchersContaining extends CustomMatchers {}
}

View File

@@ -91,7 +91,7 @@ export function EmbyServerEditDialog({ open, onClose, server }: Props) {
if (open) {
reset(server ?? emptyDefaults);
}
}, [reset, open]);
}, [reset, open, server]);
// These are updated in a watch callback, so we debounce them
// along with the details we use to check server status. Otherwise

View File

@@ -92,7 +92,7 @@ export function JellyfinServerEditDialog({ open, onClose, server }: Props) {
if (open) {
reset(server ?? emptyDefaults);
}
}, [reset, open]);
}, [reset, open, server]);
// These are updated in a watch callback, so we debounce them
// along with the details we use to check server status. Otherwise

View File

@@ -90,7 +90,7 @@ export function PlexServerEditDialog({ open, onClose, server }: Props) {
if (open) {
reset(server ?? emptyDefaults);
}
}, [open, reset]);
}, [open, reset, server]);
const updatePlexServerMutation = useMutation({
mutationFn: async (newOrUpdatedServer: PlexServerSettingsForm) => {

View File

@@ -5,7 +5,7 @@ import { useScheduledSlotProgramDetails } from '@/hooks/slot_scheduler/useSchedu
import { Delete, Edit, Warning } from '@mui/icons-material';
import {
Box,
BoxProps,
type BoxProps,
Dialog,
DialogTitle,
IconButton,

View File

@@ -2,7 +2,7 @@ import { Close, Refresh } from '@mui/icons-material';
import { Button, Stack } from '@mui/material';
import { useQuery } from '@tanstack/react-query';
import { useSnackbar } from 'notistack';
import { StrictOmit } from 'ts-essentials';
import type { StrictOmit } from 'ts-essentials';
import { getApiVersionOptions } from '../generated/@tanstack/react-query.gen.ts';
export const useVersion = (

View File

@@ -44,7 +44,7 @@ import { getProgramGroupingKey } from '../../helpers/programUtil.ts';
import { lineupItemAppearsInSchedule } from '../../helpers/slotSchedulerUtil';
import { useUpdateLineup } from '../../hooks/useUpdateLineup';
import { resetLineup } from '../../store/channelEditor/actions';
import { Maybe } from '../../types/util.ts';
import type { Maybe } from '../../types/util.ts';
dayjs.extend(duration);

View File

@@ -62,7 +62,7 @@ import { toggle } from '../../helpers/util.ts';
import { useScheduleSlots } from '../../hooks/slot_scheduler/useScheduleSlots.ts';
import { useUpdateLineup } from '../../hooks/useUpdateLineup.ts';
import { resetLineup } from '../../store/channelEditor/actions.ts';
import { Maybe } from '../../types/util.ts';
import type { Maybe } from '../../types/util.ts';
dayjs.extend(utc);
dayjs.extend(timezone);