fix: resolve all lint errors across source and test files
- Fix unused function parameters (prefix with _) - Fix unused imports in test files - Fix import ordering in test files - Auto-fix formatting issues across 22 files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { beforeEach, describe, expect, it } from "bun:test";
|
||||
import { Hono } from "hono";
|
||||
import {
|
||||
globalItemTags,
|
||||
globalItems,
|
||||
globalItemTags,
|
||||
items,
|
||||
tags,
|
||||
} from "../../src/db/schema.ts";
|
||||
@@ -102,9 +102,7 @@ describe("Global Item Routes", () => {
|
||||
.insert(globalItemTags)
|
||||
.values({ globalItemId: gi1.id, tagId: tag.id });
|
||||
|
||||
const res = await app.request(
|
||||
"/api/global-items?tags=ultralight",
|
||||
);
|
||||
const res = await app.request("/api/global-items?tags=ultralight");
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
const body = await res.json();
|
||||
|
||||
@@ -2,7 +2,6 @@ import { beforeEach, describe, expect, it, mock } from "bun:test";
|
||||
import { createHash, randomBytes } from "node:crypto";
|
||||
import { Hono } from "hono";
|
||||
import { oauthRoutes, wellKnownRoute } from "../../src/server/routes/oauth.ts";
|
||||
import { createApiKey } from "../../src/server/services/auth.service.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
// Mock @hono/oidc-auth — must be before importing routes
|
||||
@@ -35,14 +34,14 @@ function generatePkce() {
|
||||
|
||||
describe("OAuth Routes", () => {
|
||||
let app: Hono;
|
||||
let db: Awaited<ReturnType<typeof createTestDb>>["db"];
|
||||
let userId: number;
|
||||
let _db: Awaited<ReturnType<typeof createTestDb>>["db"];
|
||||
let _userId: number;
|
||||
|
||||
beforeEach(async () => {
|
||||
const testApp = await createTestApp();
|
||||
app = testApp.app;
|
||||
db = testApp.db;
|
||||
userId = testApp.userId;
|
||||
_db = testApp.db;
|
||||
_userId = testApp.userId;
|
||||
mockGetAuth.mockReset();
|
||||
// Default: user is authenticated via OIDC
|
||||
mockGetAuth.mockReturnValue({
|
||||
|
||||
@@ -3,13 +3,9 @@ import { zValidator } from "@hono/zod-validator";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { Hono } from "hono";
|
||||
import * as schema from "../../src/db/schema.ts";
|
||||
import { parseId } from "../../src/server/lib/params.ts";
|
||||
import { profileRoutes } from "../../src/server/routes/profiles.ts";
|
||||
import { setupRoutes } from "../../src/server/routes/setups.ts";
|
||||
import {
|
||||
getPublicSetupWithItems,
|
||||
updateProfile,
|
||||
} from "../../src/server/services/profile.service.ts";
|
||||
import { updateProfile } from "../../src/server/services/profile.service.ts";
|
||||
import { updateProfileSchema } from "../../src/shared/schemas.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { beforeEach, describe, expect, it } from "bun:test";
|
||||
import {
|
||||
globalItemTags,
|
||||
globalItems,
|
||||
globalItemTags,
|
||||
items,
|
||||
tags,
|
||||
} from "../../src/db/schema.ts";
|
||||
@@ -151,7 +151,7 @@ describe("Global Item Service", () => {
|
||||
brand: "Revelate Designs",
|
||||
model: "Terrapin System",
|
||||
});
|
||||
const gi2 = await insertGlobalItem(db, {
|
||||
const _gi2 = await insertGlobalItem(db, {
|
||||
brand: "Apidura",
|
||||
model: "Handlebar Pack",
|
||||
});
|
||||
@@ -205,9 +205,7 @@ describe("Global Item Service", () => {
|
||||
await tagGlobalItem(db, gi2.id, tag.id);
|
||||
|
||||
// Both tagged bikepacking, but only one matches "terrapin"
|
||||
const results = await searchGlobalItems(db, "terrapin", [
|
||||
"bikepacking",
|
||||
]);
|
||||
const results = await searchGlobalItems(db, "terrapin", ["bikepacking"]);
|
||||
expect(results).toHaveLength(1);
|
||||
expect(results[0].model).toBe("Terrapin System");
|
||||
});
|
||||
|
||||
@@ -180,10 +180,7 @@ describe("Item Service", () => {
|
||||
imageUrl?: string;
|
||||
},
|
||||
) {
|
||||
const [row] = await testDb
|
||||
.insert(globalItems)
|
||||
.values(data)
|
||||
.returning();
|
||||
const [row] = await testDb.insert(globalItems).values(data).returning();
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
getSetupWithItems,
|
||||
updateSetup,
|
||||
} from "../../src/server/services/setup.service.ts";
|
||||
import { createSecondTestUser, createTestDb } from "../helpers/db.ts";
|
||||
import { createTestDb } from "../helpers/db.ts";
|
||||
|
||||
type Db = Awaited<ReturnType<typeof createTestDb>>["db"];
|
||||
|
||||
@@ -72,11 +72,11 @@ describe("Profile Service", () => {
|
||||
|
||||
it("returns only public setups, not private ones", async () => {
|
||||
// Create one public and one private setup
|
||||
const pub = await createSetup(db, userId, {
|
||||
const _pub = await createSetup(db, userId, {
|
||||
name: "Public Setup",
|
||||
isPublic: true,
|
||||
});
|
||||
const priv = await createSetup(db, userId, { name: "Private Setup" });
|
||||
const _priv = await createSetup(db, userId, { name: "Private Setup" });
|
||||
|
||||
const profile = await getPublicProfile(db, userId);
|
||||
expect(profile).not.toBeNull();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test";
|
||||
import { beforeEach, describe, expect, mock, test } from "bun:test";
|
||||
|
||||
// Mock the S3 client send method
|
||||
const mockSend = mock(() => Promise.resolve({}));
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { beforeEach, describe, expect, it } from "bun:test";
|
||||
import { globalItems, items } from "../../src/db/schema.ts";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { globalItems } from "../../src/db/schema.ts";
|
||||
import {
|
||||
createCandidate,
|
||||
createThread,
|
||||
@@ -629,10 +628,7 @@ describe("Thread Service", () => {
|
||||
imageUrl?: string;
|
||||
},
|
||||
) {
|
||||
const [row] = await testDb
|
||||
.insert(globalItems)
|
||||
.values(data)
|
||||
.returning();
|
||||
const [row] = await testDb.insert(globalItems).values(data).returning();
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user