diff --git a/eslint.config.js b/eslint.config.js index b6e37685..ab746045 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -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', ], }, diff --git a/server/cjs-shim.ts b/server/cjs-shim.ts index b8f2373e..e5062bbb 100644 --- a/server/cjs-shim.ts +++ b/server/cjs-shim.ts @@ -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 */ diff --git a/server/package.json b/server/package.json index c93cf306..7bf8435b 100644 --- a/server/package.json +++ b/server/package.json @@ -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", diff --git a/server/src/Server.ts b/server/src/Server.ts index 4688d1bd..51ebdc3f 100644 --- a/server/src/Server.ts +++ b/server/src/Server.ts @@ -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'; diff --git a/server/src/db/json/SchemaBackedJsonDBAdapter.ts b/server/src/db/json/SchemaBackedJsonDBAdapter.ts index ed7d3bac..752d1453 100644 --- a/server/src/db/json/SchemaBackedJsonDBAdapter.ts +++ b/server/src/db/json/SchemaBackedJsonDBAdapter.ts @@ -74,7 +74,6 @@ export class SchemaBackedDbAdapter } // 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; } diff --git a/server/src/db/json/SyncSchemaBackedJSONDBAdapter.ts b/server/src/db/json/SyncSchemaBackedJSONDBAdapter.ts index a340d6a8..dad4ff12 100644 --- a/server/src/db/json/SyncSchemaBackedJSONDBAdapter.ts +++ b/server/src/db/json/SyncSchemaBackedJSONDBAdapter.ts @@ -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'; diff --git a/server/tests/vitest.d.ts b/server/tests/vitest.d.ts index 4cf6822c..3f75bde2 100644 --- a/server/tests/vitest.d.ts +++ b/server/tests/vitest.d.ts @@ -1,11 +1,12 @@ -import { Channel } from '../src/db/entities/Channel.ts'; +import type { Channel } from '../src/db/entities/Channel.ts'; interface CustomMatchers { 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 extends CustomMatchers {} + // eslint-disable-next-line @typescript-eslint/no-empty-object-type interface AsymmetricMatchersContaining extends CustomMatchers {} } diff --git a/web/src/components/settings/media_source/EmbyServerEditDialog.tsx b/web/src/components/settings/media_source/EmbyServerEditDialog.tsx index 9b10f873..c68b4b9a 100644 --- a/web/src/components/settings/media_source/EmbyServerEditDialog.tsx +++ b/web/src/components/settings/media_source/EmbyServerEditDialog.tsx @@ -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 diff --git a/web/src/components/settings/media_source/JelllyfinServerEditDialog.tsx b/web/src/components/settings/media_source/JelllyfinServerEditDialog.tsx index 5bd9e007..47fe84c2 100644 --- a/web/src/components/settings/media_source/JelllyfinServerEditDialog.tsx +++ b/web/src/components/settings/media_source/JelllyfinServerEditDialog.tsx @@ -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 diff --git a/web/src/components/settings/media_source/PlexServerEditDialog.tsx b/web/src/components/settings/media_source/PlexServerEditDialog.tsx index 2a0ce10c..18163851 100644 --- a/web/src/components/settings/media_source/PlexServerEditDialog.tsx +++ b/web/src/components/settings/media_source/PlexServerEditDialog.tsx @@ -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) => { diff --git a/web/src/components/slot_scheduler/TimeSlotTable.tsx b/web/src/components/slot_scheduler/TimeSlotTable.tsx index d3608bba..ec82c35f 100644 --- a/web/src/components/slot_scheduler/TimeSlotTable.tsx +++ b/web/src/components/slot_scheduler/TimeSlotTable.tsx @@ -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, diff --git a/web/src/hooks/useVersion.tsx b/web/src/hooks/useVersion.tsx index dfa8c696..a4231862 100644 --- a/web/src/hooks/useVersion.tsx +++ b/web/src/hooks/useVersion.tsx @@ -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 = ( diff --git a/web/src/pages/channels/RandomSlotEditorPage.tsx b/web/src/pages/channels/RandomSlotEditorPage.tsx index bec909d6..4242e9dc 100644 --- a/web/src/pages/channels/RandomSlotEditorPage.tsx +++ b/web/src/pages/channels/RandomSlotEditorPage.tsx @@ -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); diff --git a/web/src/pages/channels/TimeSlotEditorPage.tsx b/web/src/pages/channels/TimeSlotEditorPage.tsx index 6dfaa5c9..7c060aa1 100644 --- a/web/src/pages/channels/TimeSlotEditorPage.tsx +++ b/web/src/pages/channels/TimeSlotEditorPage.tsx @@ -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);