fix: resolve lint errors from phase 32/33/34 execution
Auto-fixed formatting issues and removed unused imports introduced by background execution agents across currency, i18n, and sharing code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { readdirSync, readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, test } from "bun:test";
|
||||
|
||||
const LOCALES_DIR = join(import.meta.dir, "../../src/client/locales");
|
||||
|
||||
function flattenKeys(
|
||||
obj: Record<string, unknown>,
|
||||
prefix = "",
|
||||
): string[] {
|
||||
function flattenKeys(obj: Record<string, unknown>, prefix = ""): string[] {
|
||||
const keys: string[] = [];
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
const fullKey = prefix ? `${prefix}.${key}` : key;
|
||||
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
||||
keys.push(
|
||||
...flattenKeys(value as Record<string, unknown>, fullKey),
|
||||
);
|
||||
keys.push(...flattenKeys(value as Record<string, unknown>, fullKey));
|
||||
} else {
|
||||
keys.push(fullKey);
|
||||
}
|
||||
@@ -22,9 +17,7 @@ function flattenKeys(
|
||||
return keys.sort();
|
||||
}
|
||||
|
||||
function loadLocale(
|
||||
locale: string,
|
||||
): Record<string, Record<string, unknown>> {
|
||||
function loadLocale(locale: string): Record<string, Record<string, unknown>> {
|
||||
const dir = join(LOCALES_DIR, locale);
|
||||
const files = readdirSync(dir).filter((f) => f.endsWith(".json"));
|
||||
const result: Record<string, Record<string, unknown>> = {};
|
||||
@@ -67,9 +60,7 @@ describe("locale key parity", () => {
|
||||
(obj, k) => (obj as Record<string, unknown>)?.[k],
|
||||
de[ns] as unknown,
|
||||
);
|
||||
expect(
|
||||
typeof value === "string" && value.length > 0,
|
||||
).toBe(true);
|
||||
expect(typeof value === "string" && value.length > 0).toBe(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import {
|
||||
CURRENCY_MARKET_MAP,
|
||||
type ExchangeRates,
|
||||
convertPrice,
|
||||
type ExchangeRates,
|
||||
getMarketForCurrency,
|
||||
} from "../../src/server/services/currency.service";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user