Fix all linter errors

- Remove unused biome suppression comment in completions.ts
- Remove unnecessary if condition in execute-bootstrap.test.ts
- Add eslint-disable comments for any type assertions in client.test.ts
- Add eslint-disable comments for expect().rejects patterns
- Fix template literal number expression with toString()
- Fix error handling in test-db.ts to avoid object stringify

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
igm
2026-01-12 17:30:00 +08:00
parent b78064caeb
commit 665092464a
21 changed files with 47 additions and 34 deletions

View File

@@ -42,7 +42,7 @@ let testCounter = 0;
const uniqueTestId = (): string => {
const timestamp = Date.now();
testCounter++;
return `${timestamp}-${testCounter.toString()}`;
return `${timestamp.toString()}-${testCounter.toString()}`;
};
/** Truncate all tables */
@@ -95,10 +95,8 @@ describeE2E("[e2e] executeBootstrap", () => {
});
afterAll(async () => {
if (db) {
await truncateAllTables(db);
await db.destroy();
}
await truncateAllTables(db);
await db.destroy();
});
test("creates superuser with correct email and password", async () => {
@@ -263,6 +261,7 @@ describeE2E("[e2e] executeBootstrap", () => {
test("throws error for password less than 8 characters", async () => {
await withTestTransaction(db, async (trx) => {
// eslint-disable-next-line @typescript-eslint/await-thenable, @typescript-eslint/no-confusing-void-expression
await expect(
executeBootstrap(trx, {
email: "admin@example.com",
@@ -274,6 +273,7 @@ describeE2E("[e2e] executeBootstrap", () => {
test("throws error for password exactly 7 characters", async () => {
await withTestTransaction(db, async (trx) => {
// eslint-disable-next-line @typescript-eslint/await-thenable, @typescript-eslint/no-confusing-void-expression
await expect(
executeBootstrap(trx, {
email: "admin@example.com",
@@ -296,6 +296,7 @@ describeE2E("[e2e] executeBootstrap", () => {
test("throws error for invalid email without @", async () => {
await withTestTransaction(db, async (trx) => {
// eslint-disable-next-line @typescript-eslint/await-thenable, @typescript-eslint/no-confusing-void-expression
await expect(
executeBootstrap(trx, {
email: "invalidemail",
@@ -326,6 +327,7 @@ describeE2E("[e2e] executeBootstrap", () => {
});
// Attempt to create the same user again
// eslint-disable-next-line @typescript-eslint/await-thenable, @typescript-eslint/no-confusing-void-expression
await expect(
executeBootstrap(trx, {
email: "admin@example.com",
@@ -552,19 +554,19 @@ describeE2E("[e2e] executeBootstrap", () => {
});
// Create another org and invite
const [otherOrg] = await trx
const otherOrg = await trx
.insertInto("orgs")
.values({
slug: `other-org-${uniqueId}`,
display_name: "Other Org",
})
.returning(["id"])
.execute();
.executeTakeFirstOrThrow();
await trx
.insertInto("org_invites")
.values({
org_id: otherOrg!.id,
org_id: otherOrg.id,
email: "invitee@example.com",
role: "member",
invited_by: result1.user.id,
@@ -611,14 +613,14 @@ describeE2E("[e2e] executeBootstrap", () => {
.execute();
// Add org invites (to the org, not by the user)
const [anotherUser] = await trx
const anotherUser = await trx
.insertInto("users")
.values({
email: `other-${uniqueId}@example.com`,
display_name: "Other User",
})
.returning(["id"])
.execute();
.executeTakeFirstOrThrow();
await trx
.insertInto("org_invites")
@@ -626,7 +628,7 @@ describeE2E("[e2e] executeBootstrap", () => {
org_id: result1.org.id,
email: "invitee@example.com",
role: "member",
invited_by: anotherUser!.id,
invited_by: anotherUser.id,
token: "invite-token-2",
expires_at: new Date(Date.now() + 86400000),
})