fix: improve type safety and remove redundant type casts (#7252)

* fix: improve type safety and remove redundant type casts

- Fix @@ts-expect-error typo (double @) in traffic-diagnostics.ts
- Replace (e.target as any) with (e.target as HTMLElement) in setting-clash.tsx
- Remove redundant (onFormat as any) cast in guard-state.tsx

* fix: format api.ts sort callback to satisfy biome

* fix: remove as any, let @ts-expect-error suppress the non-standard API error

* fix: remove invalid @@ts-expect-error comment, keep as any for non-standard API
This commit is contained in:
sijie-Z
2026-06-17 12:47:31 +00:00
committed by GitHub
parent aa0d5f6004
commit 4105dc7479
4 changed files with 5 additions and 4 deletions
+3 -1
View File
@@ -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)