fix: resolve all 69 ESLint warnings across 40 files

- Remove unused imports (Mail, CalendarIcon, Plus, Circle, cn, Link,
  MessageCircle, User, Tag, FolderUp, useEffect, LogOut, GripVertical,
  Check, X, HoverActionsMode, HoverActionsCorner, asn1js, Convert, etc.)
- Prefix unused variables/params with underscore to satisfy no-unused-vars
- Add missing React hook dependencies (exhaustive-deps)
- Wrap handleNavigateUp in useCallback and selectedGroupMembers in useMemo
- Remove unused eslint-disable directives in jmap/client.ts
- Replace as any with typed casts in filter-store and smime-store tests
- Remove dead code (macOk assignment, unused now variable)
This commit is contained in:
Linus Rath
2026-03-26 18:35:56 +01:00
parent 733e99f094
commit 7a191cf78b
40 changed files with 62 additions and 68 deletions
+2 -2
View File
@@ -186,7 +186,7 @@ export default function CalendarPage() {
if (client && enableCalendarTasks && (normalizedViewMode === "tasks" || showTasksOnCalendar)) {
taskStore.fetchTasks(client);
}
}, [client, enableCalendarTasks, normalizedViewMode, showTasksOnCalendar]);
}, [client, enableCalendarTasks, normalizedViewMode, showTasksOnCalendar, taskStore]);
useEffect(() => {
if (client && calendars.length > 0 && dateRange) {
@@ -704,7 +704,7 @@ export default function CalendarPage() {
};
window.addEventListener("keydown", handleKey);
return () => window.removeEventListener("keydown", handleKey);
}, [navigatePrev, navigateNext, goToToday, setViewMode, openCreateModal, showEventModal, detailEvent]);
}, [navigatePrev, navigateNext, goToToday, setViewMode, openCreateModal, showEventModal, detailEvent, enableCalendarTasks]);
const visibleEvents = useMemo(() =>
events.filter((e) => {
+2 -2
View File
@@ -122,7 +122,7 @@ export default function ContactsPage() {
const individuals = useMemo(() => contacts.filter(c => c.kind !== 'group'), [contacts]);
const selectedContact = contacts.find((c) => c.id === selectedContactId) || null;
const selectedGroup = selectedGroupId ? contacts.find(c => c.id === selectedGroupId) || null : null;
const selectedGroupMembers = selectedGroupId ? getGroupMembers(selectedGroupId) : [];
const selectedGroupMembers = useMemo(() => selectedGroupId ? getGroupMembers(selectedGroupId) : [], [selectedGroupId, getGroupMembers]);
// Collect all unique keywords across contacts
const allKeywords = useMemo(() => {
@@ -307,7 +307,7 @@ export default function ContactsPage() {
}
};
const handleSelectGroup = (id: string) => {
const _handleSelectGroup = (id: string) => {
setSelectedGroupId(id);
setActiveCategory({ groupId: id });
setView("group-detail");
+1 -1
View File
@@ -45,7 +45,7 @@ export default function FilesPage() {
navigateByPath,
refresh,
createDirectory,
uploadFile,
uploadFile: _uploadFile,
uploadFiles,
uploadFolder,
deleteResource,
+1 -1
View File
@@ -11,7 +11,7 @@ import { useThemeStore } from "@/stores/theme-store";
import { useShallow } from "zustand/react/shallow";
import { useConfig } from "@/hooks/use-config";
import { cn } from "@/lib/utils";
import { Mail, AlertCircle, Loader2, X, Info, Eye, EyeOff, LogIn, Sun, Moon, Monitor, Check, Shield, Play } from "lucide-react";
import { AlertCircle, Loader2, X, Info, Eye, EyeOff, LogIn, Sun, Moon, Monitor, Check, Shield, Play } from "lucide-react";
import { discoverOAuth, type OAuthMetadata } from "@/lib/oauth/discovery";
import { generateCodeVerifier, generateCodeChallenge, generateState } from "@/lib/oauth/pkce";
import { OAUTH_SCOPES } from "@/lib/oauth/tokens";
+1 -1
View File
@@ -3,7 +3,7 @@
import { useEffect, useState, useRef } from 'react';
import { Upload, Trash2, Power, Loader2, Palette, Save, Shield } from 'lucide-react';
import type { SettingsPolicy } from '@/lib/admin/types';
import { DEFAULT_POLICY, DEFAULT_THEME_POLICY, DEFAULT_FEATURE_GATES } from '@/lib/admin/types';
import { DEFAULT_POLICY, DEFAULT_THEME_POLICY } from '@/lib/admin/types';
const BUILTIN_THEME_OPTIONS = [
{ id: 'builtin-nord', name: 'Nord' },
+1 -1
View File
@@ -89,7 +89,7 @@ function localDateTime(dayOffset: number, hour: number, minute: number): string
}
/** Parse a JMAP duration like "PT1H30M", "P1D", "PT45M" into milliseconds. */
function parseDurationMs(dur: string): number {
function _parseDurationMs(dur: string): number {
let ms = 0;
const dayMatch = dur.match(/(\d+)D/);
const hourMatch = dur.match(/(\d+)H/);