fix: resolve pre-existing lint warnings
- Remove unused siteSettings import in auth-precheck.test.ts - Replace non-null assertions with proper null checks in furni-data-i18n.ts - Replace non-null assertions with proper null checks in conversion-pool.ts
This commit is contained in:
1 parent
adf0658916
commit
a7ccc98f84
3 files changed
+15
-7
No files matched your search
@@ -2,7 +2,6 @@
|
|||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { clientIp, rateLimit } from "@/lib/rate-limit";
|
import { clientIp, rateLimit } from "@/lib/rate-limit";
|
||||||
import { captchaConfig, verifyCaptcha } from "@/lib/services/captcha";
|
import { captchaConfig, verifyCaptcha } from "@/lib/services/captcha";
|
||||||
import { siteSettings } from "@/lib/services/site-settings";
|
|
||||||
import { precheckLogin } from "./auth-precheck";
|
import { precheckLogin } from "./auth-precheck";
|
||||||
|
|
||||||
const core = vi.hoisted(() => ({
|
const core = vi.hoisted(() => ({
|
||||||
|
|||||||
@@ -457,13 +457,17 @@ export async function buildLocalizedFurniDataFiles(
|
|||||||
translatedWall = res.translatedWall;
|
translatedWall = res.translatedWall;
|
||||||
total = res.total;
|
total = res.total;
|
||||||
} else {
|
} else {
|
||||||
const r = localPrepared.get(preparedKey!)!;
|
const r = localPrepared.get(preparedKey ?? "");
|
||||||
|
if (!r)
|
||||||
|
throw new Error(
|
||||||
|
`Missing localPrepared entry for key ${String(preparedKey)}`,
|
||||||
|
);
|
||||||
const res = finalizeLangFile(r.cloned, r.pendingRefs, translations);
|
const res = finalizeLangFile(r.cloned, r.pendingRefs, translations);
|
||||||
json = res.json;
|
json = res.json;
|
||||||
translatedRoom = res.translatedRoom;
|
translatedRoom = res.translatedRoom;
|
||||||
translatedWall = res.translatedWall;
|
translatedWall = res.translatedWall;
|
||||||
total = res.total;
|
total = res.total;
|
||||||
localPrepared.delete(preparedKey!);
|
if (preparedKey != null) localPrepared.delete(preparedKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
const targets = await getLocalizedWritePaths(lang);
|
const targets = await getLocalizedWritePaths(lang);
|
||||||
@@ -593,13 +597,17 @@ export async function patchLocalizedFurniDataEntries(
|
|||||||
added = res.added;
|
added = res.added;
|
||||||
total = res.total;
|
total = res.total;
|
||||||
} else {
|
} else {
|
||||||
const r = localPrepared.get(localKey!)!;
|
const r = localPrepared.get(localKey ?? "");
|
||||||
|
if (!r)
|
||||||
|
throw new Error(
|
||||||
|
`Missing localPrepared entry for key ${String(localKey)}`,
|
||||||
|
);
|
||||||
const res = finalizePatch(r, translations);
|
const res = finalizePatch(r, translations);
|
||||||
json = res.json;
|
json = res.json;
|
||||||
patched = res.patched;
|
patched = res.patched;
|
||||||
added = res.added;
|
added = res.added;
|
||||||
total = res.total;
|
total = res.total;
|
||||||
localPrepared.delete(localKey!);
|
if (localKey != null) localPrepared.delete(localKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
|
|||||||
@@ -79,8 +79,9 @@ function ensurePool(): boolean {
|
|||||||
|
|
||||||
function pump() {
|
function pump() {
|
||||||
while (idle.length > 0 && queue.length > 0) {
|
while (idle.length > 0 && queue.length > 0) {
|
||||||
const w = idle.pop()!;
|
const w = idle.pop();
|
||||||
const job = queue.shift()!;
|
const job = queue.shift();
|
||||||
|
if (!w || !job) break;
|
||||||
pending.set(job.req.id, { worker: w, job });
|
pending.set(job.req.id, { worker: w, job });
|
||||||
w.postMessage(job.req);
|
w.postMessage(job.req);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user