diff --git a/src/components/setting/mods/guard-state.tsx b/src/components/setting/mods/guard-state.tsx index a1726bce8..09227e73c 100644 --- a/src/components/setting/mods/guard-state.tsx +++ b/src/components/setting/mods/guard-state.tsx @@ -45,7 +45,7 @@ export function GuardState(props: Props) { lockRef.current = true try { - const newValue = onFormat ? (onFormat as any)(...args) : (args[0] as T) + const newValue = onFormat ? onFormat(...args) : (args[0] as T) // 先在ui上响应操作 onChange(newValue) diff --git a/src/components/setting/setting-clash.tsx b/src/components/setting/setting-clash.tsx index c41d97d37..60cd3e9c0 100644 --- a/src/components/setting/setting-clash.tsx +++ b/src/components/setting/setting-clash.tsx @@ -224,7 +224,7 @@ const SettingClash = ({ onError }: Props) => { sx={{ width: 100, input: { py: '7.5px', cursor: 'pointer' } }} onClick={(e) => { portRef.current?.open() - ;(e.target as any).blur() + ;(e.target as HTMLElement).blur() }} /> diff --git a/src/services/api.ts b/src/services/api.ts index 966b7fe76..888a1bf69 100644 --- a/src/services/api.ts +++ b/src/services/api.ts @@ -145,7 +145,9 @@ export const getIpInfo = async (): Promise< const maxRetries = 2 const serviceTimeout = 5000 - const shuffledServices = IP_CHECK_SERVICES.slice().sort(() => Math.random() - 0.5) + const shuffledServices = IP_CHECK_SERVICES.slice().sort( + () => Math.random() - 0.5, + ) let lastError: unknown | null = null const userAgent = await getUserAgentPromise() console.debug('User-Agent for IP detection:', userAgent) diff --git a/src/utils/traffic-diagnostics.ts b/src/utils/traffic-diagnostics.ts index c8642c80d..f8c81882b 100644 --- a/src/utils/traffic-diagnostics.ts +++ b/src/utils/traffic-diagnostics.ts @@ -39,7 +39,6 @@ export function recordTrafficError(error: Error, component: string) { */ function getMemoryUsage(): number { if ('memory' in performance) { - // @@ts-expect-error - 某些浏览器支持 const memory = (performance as any).memory if (memory && memory.usedJSHeapSize) { return memory.usedJSHeapSize / 1024 / 1024 // 转换为MB