fix: resolve all frontend lint errors for unused imports and type issues

- Remove unused type imports: SnapshotAlertConfig, PMGThresholdDefaults, RawOverrideConfig, BackupAlertConfig
- Remove unused imports: Settings, Power, JSX, onMount, createEffect
- Remove unused function _getUnitSuffix
- Fix GuestDefaults type to avoid index signature conflict
- Prefix unused catch variables with underscore
- Fix StickyNote title prop by wrapping in span element
This commit is contained in:
rcourtman 2025-12-18 17:07:05 +00:00
parent 90a9b78e02
commit 3b36e4965f
7 changed files with 20 additions and 18 deletions

View file

@ -253,7 +253,7 @@ export const AIChat: Component<AIChatProps> = (props) => {
await AIAPI.updateSettings({ autonomous_mode: newValue });
setAutonomousMode(newValue);
notificationStore.success(newValue ? 'Autonomous mode enabled' : 'Autonomous mode disabled');
} catch (e) {
} catch (_e) {
notificationStore.error('Failed to toggle autonomous mode');
} finally {
setIsTogglingAutonomous(false);

View file

@ -5,7 +5,7 @@
* Shows at the top of each section with editable threshold badges.
*/
import { Component, Show, For, createSignal, createEffect, createMemo } from 'solid-js';
import { Component, Show, For, createSignal, createMemo } from 'solid-js';
import Settings from 'lucide-solid/icons/settings';
import RotateCcw from 'lucide-solid/icons/rotate-ccw';
import Check from 'lucide-solid/icons/check';

View file

@ -5,7 +5,7 @@
* Replaces wide table rows with a compact, mobile-friendly design.
*/
import { Component, Show, For, createSignal, createMemo, JSX } from 'solid-js';
import { Component, Show, For, createSignal, createMemo } from 'solid-js';
import ChevronDown from 'lucide-solid/icons/chevron-down';
import ChevronUp from 'lucide-solid/icons/chevron-up';
import Settings from 'lucide-solid/icons/settings';
@ -14,7 +14,7 @@ import Check from 'lucide-solid/icons/check';
import X from 'lucide-solid/icons/x';
import Bell from 'lucide-solid/icons/bell';
import BellOff from 'lucide-solid/icons/bell-off';
import Power from 'lucide-solid/icons/power';
import ExternalLink from 'lucide-solid/icons/external-link';
import StickyNote from 'lucide-solid/icons/sticky-note';
import { ThresholdBadge, ThresholdBadgeGroup } from './ThresholdBadge';
@ -189,7 +189,9 @@ export const ResourceCard: Component<ResourceCardProps> = (props) => {
{/* Has note indicator */}
<Show when={props.resource.note}>
<StickyNote class="w-3.5 h-3.5 text-yellow-500" title={props.resource.note} />
<span title={props.resource.note}>
<StickyNote class="w-3.5 h-3.5 text-yellow-500" />
</span>
</Show>
{/* Disabled badge */}

View file

@ -69,15 +69,6 @@ const formatDisplayValue = (metric: string, value: number | undefined): string =
return String(value);
};
/**
* Get the unit suffix for a metric
*/
const getUnitSuffix = (metric: string): string => {
if (['cpu', 'memory', 'disk', 'usage'].includes(metric)) return '%';
if (metric === 'temperature') return '°C';
if (['diskRead', 'diskWrite', 'networkIn', 'networkOut'].includes(metric)) return ' MB/s';
return '';
};
/**
* Get readable label for a metric

View file

@ -5,7 +5,7 @@
* Provides a clean interface for toggling sections and remembering user preferences.
*/
import { createSignal, createEffect, onMount } from 'solid-js';
import { createSignal, createEffect } from 'solid-js';
const STORAGE_KEY = 'pulse-thresholds-collapsed-sections';

View file

@ -8,7 +8,7 @@
import { Component, Show, createSignal, createEffect, JSX } from 'solid-js';
import ChevronRight from 'lucide-solid/icons/chevron-right';
import ChevronDown from 'lucide-solid/icons/chevron-down';
import Settings from 'lucide-solid/icons/settings';
export interface CollapsibleSectionProps {
/** Unique identifier for the section */

View file

@ -6,7 +6,7 @@
*/
import type { Alert } from '@/types/api';
import type { RawOverrideConfig, PMGThresholdDefaults, SnapshotAlertConfig, BackupAlertConfig } from '@/types/alerts';
// Alert types imported from shared alert types
// ============================================================================
// Resource Types
@ -182,7 +182,16 @@ export interface EditingActions {
/**
* Default threshold configuration for guests
*/
export interface GuestDefaults extends ThresholdValues {
export interface GuestDefaults {
cpu?: number;
memory?: number;
disk?: number;
diskRead?: number;
diskWrite?: number;
networkIn?: number;
networkOut?: number;
temperature?: number;
usage?: number;
disableConnectivity?: boolean;
poweredOffSeverity?: 'warning' | 'critical';
}