perf: cut biome lint from 25s to 1s and fix pre-existing lint failures

Exclude generated drizzle-kit snapshot artifacts from formatting checks (drizzle/drafts/meta), which made biome scan a 360KB generated JSON for 23s. Fix the pre-existing lint errors in error-monitor, article-form and the admin-search-permissions mock so pnpm biome:lint is green in CI.
This commit is contained in:
openhands committed 2026-09-08 18:22:49 +02:00
1 parent 54b7c67878
commit cbffb565ec
4 files changed
+7 -5

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
},
"files": {
"ignoreUnknown": false,
"includes": ["**", "!setup", "!*.cjs", "!coverage"]
"includes": ["**", "!setup", "!*.cjs", "!coverage", "!drizzle/drafts/meta"]
},
"formatter": {
"enabled": true,
+1 -1
View File
@@ -14,7 +14,7 @@ export function ArticleForm({
action,
defaultValues,
}: {
action: (formData: FormData) => Promise<ArticleSaveResult | void>;
action: (formData: FormData) => Promise<ArticleSaveResult | undefined>;
edit?: boolean;
defaultValues?: {
title?: string;
+3 -1
View File
@@ -5,7 +5,9 @@ const state = vi.hoisted(() => ({
queried: [] as unknown[],
}));
vi.mock("@/lib/api-handler", () => ({
withAdmin: (_: unknown, handler: Function) => (request: unknown) =>
withAdmin:
(_: unknown, handler: (...args: unknown[]) => unknown) =>
(request: unknown) =>
handler(request, {
session: { user: { id: 1, rank: 7 } },
permissions: { isSuperAdmin: false },
+2 -2
View File
@@ -115,12 +115,12 @@ export class ErrorStore {
name.slice(0, 10) < cutoff
)
await unlink(path.join(this.directory, name)).catch(() => {});
const file = path.join(this.directory, record.at.slice(0, 10) + ".jsonl");
const file = path.join(this.directory, `${record.at.slice(0, 10)}.jsonl`);
const size = await stat(file)
.then((s) => s.size)
.catch(() => 0);
if (size >= DAY_LIMIT) throw new Error("Daily error storage limit reached");
await appendFile(file, JSON.stringify(record) + "\n", { mode: 0o600 });
await appendFile(file, `${JSON.stringify(record)}\n`, { mode: 0o600 });
}
async resolve(fingerprint: string) {
if (!/^[a-f0-9]{16}$/.test(fingerprint))