Fix lint errors: remove unused imports and fix type assertions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-04-12 21:57:56 +02:00
parent c136bc9247
commit 1237cdee4f
7 changed files with 7 additions and 12 deletions

View File

@@ -36,7 +36,7 @@ export default function LoginClient({ enabledProviders = [] }: LoginClientProps)
return;
}
const { data, error } = await authClient.signIn.username({
const { error } = await authClient.signIn.username({
username,
password,
});

View File

@@ -1,6 +1,5 @@
import { betterAuth } from "better-auth";
import { genericOAuth, username } from "better-auth/plugins";
import { randomUUID } from "node:crypto";
import db, { sqlite } from "./db";
import * as schema from "./db/schema";
import { eq } from "drizzle-orm";
@@ -87,12 +86,11 @@ function createAuth(): any {
// behind reverse proxies that rewrite Host without setting X-Forwarded-Host.
trustHost: process.env.AUTH_TRUST_HOST === "true",
trustedOrigins: [config.baseUrl],
// eslint-disable-next-line @typescript-eslint/no-explicit-any
advanced: {
database: {
generateId: "serial",
},
} as any,
} as Record<string, unknown>,
rateLimit: {
enabled: process.env.AUTH_RATE_LIMIT_ENABLED !== "false",
window: Number(process.env.AUTH_RATE_LIMIT_WINDOW ?? 60),

View File

@@ -31,8 +31,7 @@ export async function auth(req?: NextRequest): Promise<Session | null> {
const resolvedHeaders = hdrs instanceof Promise ? await hdrs : hdrs;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let betterAuthSession: any = null;
let betterAuthSession: any;
try {
betterAuthSession = await getAuth().api.getSession({
headers: resolvedHeaders,

View File

@@ -2,7 +2,6 @@ import { Database } from "bun:sqlite";
import { drizzle } from "drizzle-orm/bun-sqlite";
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
import { eq, ne, and, isNull } from "drizzle-orm";
import { randomUUID } from "node:crypto";
import { mkdirSync } from "node:fs";
import { dirname, isAbsolute, resolve as resolvePath } from "node:path";
import * as schema from "./db/schema";
@@ -198,7 +197,7 @@ function runEnvProviderSync() {
// Lazy import to avoid circular dependency at module load
let config: { oauth: { enabled: boolean; providerName: string; clientId: string | null; clientSecret: string | null; issuer: string | null; authorizationUrl: string | null; tokenUrl: string | null; userinfoUrl: string | null; allowAutoLinking: boolean } };
try {
config = require("./config").config;
config = require("./config").config; // eslint-disable-line @typescript-eslint/no-require-imports
} catch {
return;
}
@@ -208,7 +207,7 @@ function runEnvProviderSync() {
const { oauthProviders } = schema;
let encryptSecret: (v: string) => string;
try {
encryptSecret = require("./secret").encryptSecret;
encryptSecret = require("./secret").encryptSecret; // eslint-disable-line @typescript-eslint/no-require-imports
} catch (e) {
console.error("CRITICAL: Failed to load encryption module, refusing to store plaintext secrets:", e);
return;

View File

@@ -1,5 +1,4 @@
import bcrypt from "bcryptjs";
import { randomUUID } from "node:crypto";
import db, { nowIso } from "./db";
import { config } from "./config";
import { users, accounts } from "./db/schema";

View File

@@ -1,7 +1,7 @@
import { randomUUID } from "node:crypto";
import db, { nowIso } from "../db";
import { oauthProviders } from "../db/schema";
import { eq, asc } from "drizzle-orm";
import { eq } from "drizzle-orm";
import { encryptSecret, decryptSecret } from "../secret";
export type OAuthProvider = {

View File

@@ -1,5 +1,5 @@
import bcrypt from "bcryptjs";
import { randomBytes, randomUUID } from "crypto";
import { randomBytes } from "crypto";
import { SignJWT, jwtVerify } from "jose";
import { config } from "../config";
import { findUserByEmail, getUserById } from "../models/user";