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:
1 parent
54b7c67878
commit
cbffb565ec
4 files changed
+11
-9
No files matched your search
+1
-1
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"includes": ["**", "!setup", "!*.cjs", "!coverage"]
|
||||
"includes": ["**", "!setup", "!*.cjs", "!coverage", "!drizzle/drafts/meta"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,11 +5,13 @@ const state = vi.hoisted(() => ({
|
||||
queried: [] as unknown[],
|
||||
}));
|
||||
vi.mock("@/lib/api-handler", () => ({
|
||||
withAdmin: (_: unknown, handler: Function) => (request: unknown) =>
|
||||
handler(request, {
|
||||
session: { user: { id: 1, rank: 7 } },
|
||||
permissions: { isSuperAdmin: false },
|
||||
}),
|
||||
withAdmin:
|
||||
(_: unknown, handler: (...args: unknown[]) => unknown) =>
|
||||
(request: unknown) =>
|
||||
handler(request, {
|
||||
session: { user: { id: 1, rank: 7 } },
|
||||
permissions: { isSuperAdmin: false },
|
||||
}),
|
||||
}));
|
||||
vi.mock("@/lib/rate-limit", () => ({ rateLimit: async () => ({ ok: true }) }));
|
||||
vi.mock("@/lib/permissions", async () => ({
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user