fix: remove 10 unused variables in File Manager and config files

Cleaned up more unused imports, parameters, and variables:
- FileManagerGrid.tsx: removed 4 unused variables (params, function)
- FileManagerContextMenu.tsx: removed Share import
- FileManagerSidebar.tsx: removed onLoadDirectory parameter
- DraggableWindow.tsx: removed Square import
- FileWindow.tsx: removed updateWindow variable
- ServerConfig.tsx: removed 2 unused error parameters

Reduced lint errors from 236 to 222 (14 errors fixed total)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-10-09 19:36:36 +08:00
parent 720b7b5972
commit e38f37a53b
8 changed files with 9 additions and 24 deletions

View File

@@ -42,9 +42,9 @@ export function CredentialEditor({
onFormSubmit,
}: CredentialEditorProps) {
const { t } = useTranslation();
const [credentials, setCredentials] = useState<Credential[]>([]);
const [, setCredentials] = useState<Credential[]>([]);
const [folders, setFolders] = useState<string[]>([]);
const [loading, setLoading] = useState(true);
const [, setLoading] = useState(true);
const [fullCredentialDetails, setFullCredentialDetails] =
useState<Credential | null>(null);
@@ -95,7 +95,7 @@ export function CredentialEditor({
try {
const fullDetails = await getCredentialDetails(editingCredential.id);
setFullCredentialDetails(fullDetails);
} catch (error) {
} catch {
toast.error(t("credentials.failedToFetchCredentialDetails"));
}
} else {

View File

@@ -35,7 +35,7 @@ export function CredentialSelector({
? data
: data.credentials || data.data || [];
setCredentials(credentialsArray);
} catch (error) {
} catch {
const { toast } = await import("sonner");
toast.error(t("credentials.failedToFetchCredentials"));
setCredentials([]);

View File

@@ -13,7 +13,6 @@ import {
RefreshCw,
Clipboard,
Eye,
Share,
ExternalLink,
Terminal,
Play,

View File

@@ -166,7 +166,6 @@ const getFileIcon = (file: FileItem, viewMode: "grid" | "list" = "grid") => {
export function FileManagerGrid({
files,
selectedFiles,
onFileSelect,
onFileOpen,
onSelectionChange,
currentPath,
@@ -188,7 +187,6 @@ export function FileManagerGrid({
onUndo,
onFileDrop,
onFileDiff,
onSystemDragStart,
onSystemDragEnd,
hasClipboard,
createIntent,
@@ -428,16 +426,6 @@ export function FileManagerGrid({
setIsEditingPath(false);
};
const handlePathInputKeyDown = (e: React.KeyboardEvent) => {
if (e.key === "Enter") {
e.preventDefault();
confirmEditingPath();
} else if (e.key === "Escape") {
e.preventDefault();
cancelEditingPath();
}
};
useEffect(() => {
if (!isEditingPath) {
setEditPathValue(currentPath);
@@ -617,7 +605,7 @@ export function FileManagerGrid({
);
useEffect(() => {
const handleGlobalMouseUp = (e: MouseEvent) => {
const handleGlobalMouseUp = () => {
if (isSelecting) {
setIsSelecting(false);
setSelectionStart(null);

View File

@@ -66,7 +66,6 @@ interface FileManagerSidebarProps {
currentHost: SSHHost;
currentPath: string;
onPathChange: (path: string) => void;
onLoadDirectory?: (path: string) => void;
onFileOpen?: (file: SidebarItem) => void;
sshSessionId?: string;
refreshTrigger?: number;
@@ -76,7 +75,6 @@ export function FileManagerSidebar({
currentHost,
currentPath,
onPathChange,
onLoadDirectory,
onFileOpen,
sshSessionId,
refreshTrigger,

View File

@@ -1,6 +1,6 @@
import React, { useState, useRef, useCallback, useEffect } from "react";
import { cn } from "@/lib/utils";
import { Minus, Square, X, Maximize2, Minimize2 } from "lucide-react";
import { Minus, X, Maximize2, Minimize2 } from "lucide-react";
import { useTranslation } from "react-i18next";
interface DraggableWindowProps {

View File

@@ -56,7 +56,7 @@ export function FileWindow({
initialY = 100,
onFileNotFound,
}: FileWindowProps) {
const { closeWindow, maximizeWindow, focusWindow, updateWindow, windows } =
const { closeWindow, maximizeWindow, focusWindow, windows } =
useWindowManager();
const { t } = useTranslation();

View File

@@ -74,7 +74,7 @@ export function ServerConfig({
setConnectionStatus("error");
setError(result.error || t("serverConfig.connectionFailed"));
}
} catch (error) {
} catch {
setConnectionStatus("error");
setError(t("serverConfig.connectionError"));
} finally {
@@ -117,7 +117,7 @@ export function ServerConfig({
} else {
setError(t("serverConfig.saveFailed"));
}
} catch (error) {
} catch {
setError(t("serverConfig.saveError"));
} finally {
setLoading(false);