chore: linting

This commit is contained in:
zhom
2026-03-28 23:31:20 +04:00
parent ba750a3401
commit 612c6610ce
36 changed files with 284 additions and 285 deletions
+6 -13
View File
@@ -22,18 +22,15 @@ export function useAutoHeight<T extends HTMLElement = HTMLDivElement>(
const el = ref.current;
if (!el) return 0;
const base = el.getBoundingClientRect().height ?? 0;
const base = el.getBoundingClientRect().height;
let extra = 0;
if (options.includeParentBox && el.parentElement) {
const cs = getComputedStyle(el.parentElement);
const paddingY =
(parseFloat(cs.paddingTop ?? "0") ?? 0) +
(parseFloat(cs.paddingBottom ?? "0") ?? 0);
const paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);
const borderY =
(parseFloat(cs.borderTopWidth ?? "0") ?? 0) +
(parseFloat(cs.borderBottomWidth ?? "0") ?? 0);
parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);
const isBorderBox = cs.boxSizing === "border-box";
if (isBorderBox) {
extra += paddingY + borderY;
@@ -42,20 +39,16 @@ export function useAutoHeight<T extends HTMLElement = HTMLDivElement>(
if (options.includeSelfBox) {
const cs = getComputedStyle(el);
const paddingY =
(parseFloat(cs.paddingTop ?? "0") ?? 0) +
(parseFloat(cs.paddingBottom ?? "0") ?? 0);
const paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);
const borderY =
(parseFloat(cs.borderTopWidth ?? "0") ?? 0) +
(parseFloat(cs.borderBottomWidth ?? "0") ?? 0);
parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);
const isBorderBox = cs.boxSizing === "border-box";
if (isBorderBox) {
extra += paddingY + borderY;
}
}
const dpr =
typeof window !== "undefined" ? (window.devicePixelRatio ?? 1) : 1;
const dpr = typeof window !== "undefined" ? window.devicePixelRatio : 1;
const total = Math.ceil((base + extra) * dpr) / dpr;
return total;
+3 -1
View File
@@ -367,7 +367,9 @@ export function useBrowserDownload() {
? loadDownloadedVersions("camoufox")
: Promise.resolve([]),
]);
} catch {}
} catch {
/* empty */
}
showDownloadToast(browserName, progress.version, "completed");
setDownloadProgress(null);
}
+1 -1
View File
@@ -50,7 +50,7 @@ export function useCloudAuth(): UseCloudAuthReturn {
};
}, [loadUser]);
const requestOtp = useCallback(async (email: string): Promise<string> => {
const requestOtp = useCallback((email: string): Promise<string> => {
return invoke<string>("cloud_request_otp", { email });
}, []);
+1 -1
View File
@@ -5,7 +5,7 @@ interface CommonControlledStateProps<T> {
defaultValue?: T;
}
export function useControlledState<T, Rest extends any[] = []>(
export function useControlledState<T, Rest extends unknown[] = []>(
props: CommonControlledStateProps<T> & {
onChange?: (value: T, ...args: Rest) => void;
},
+1 -1
View File
@@ -17,7 +17,7 @@ export function useProxyEvents() {
// Load proxy usage (how many profiles are using each proxy)
const loadProxyUsage = useCallback(async () => {
try {
const profiles = await invoke<Array<{ proxy_id?: string }>>(
const profiles = await invoke<{ proxy_id?: string }[]>(
"list_browser_profiles",
);
const counts: Record<string, number> = {};
+1 -1
View File
@@ -16,7 +16,7 @@ export function useVpnEvents() {
const loadVpnUsage = useCallback(async () => {
try {
const profiles = await invoke<Array<{ vpn_id?: string }>>(
const profiles = await invoke<{ vpn_id?: string }[]>(
"list_browser_profiles",
);
const counts: Record<string, number> = {};