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