fix: resolve linting issues (curly braces, unused imports, any types)

This commit is contained in:
Jadilson Guedes
2026-02-16 16:40:40 -03:00
committed by Peter Steinberger
parent 075317ab16
commit d30f5a2438
4 changed files with 18 additions and 8 deletions

View File

@@ -33,7 +33,9 @@ class I18nManager {
}
public async setLocale(locale: Locale) {
if (this.locale === locale) return;
if (this.locale === locale) {
return;
}
// Lazy load translations if needed
if (!this.translations[locale]) {
@@ -75,7 +77,7 @@ class I18nManager {
public t(key: string, params?: Record<string, string>): string {
const keys = key.split(".");
let value: any = this.translations[this.locale] || this.translations["en"];
let value: unknown = this.translations[this.locale] || this.translations["en"];
for (const k of keys) {
if (value && typeof value === "object") {

View File

@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach, vi } from "vitest";
import { describe, it, expect, beforeEach } from "vitest";
import { i18n, t } from "../lib/translate.ts";
describe("i18n", () => {

View File

@@ -1,7 +1,7 @@
import { html, nothing } from "lit";
import type { AppViewState } from "./app-view-state.ts";
import { parseAgentSessionKey } from "../../../src/routing/session-key.js";
import { t, i18n, type Locale } from "../i18n/index.ts";
import { t } from "../i18n/index.ts";
import { refreshChatAvatar } from "./app-chat.ts";
import { renderUsageTab } from "./app-render-usage-tab.ts";
import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers.ts";

View File

@@ -33,10 +33,14 @@ export function renderOverview(props: OverviewProps) {
: t("common.na");
const authHint = (() => {
if (props.connected || !props.lastError) return null;
if (props.connected || !props.lastError) {
return null;
}
const lower = props.lastError.toLowerCase();
const authFailed = lower.includes("unauthorized") || lower.includes("connect failed");
if (!authFailed) return null;
if (!authFailed) {
return null;
}
const hasToken = Boolean(props.settings.token.trim());
const hasPassword = Boolean(props.password.trim());
if (!hasToken && !hasPassword) {
@@ -78,9 +82,13 @@ export function renderOverview(props: OverviewProps) {
})();
const insecureContextHint = (() => {
if (props.connected || !props.lastError) return null;
if (props.connected || !props.lastError) {
return null;
}
const isSecureContext = typeof window !== "undefined" ? window.isSecureContext : true;
if (isSecureContext !== false) return null;
if (isSecureContext !== false) {
return null;
}
const lower = props.lastError.toLowerCase();
if (!lower.includes("secure context") && !lower.includes("device identity required")) {
return null;