Switch to vercel's biome setup (#543)

This commit is contained in:
Jared Palmer 2024-11-15 13:00:15 -05:00 committed by GitHub
parent b8643353c0
commit 43aa1c6e58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 414 additions and 201 deletions

View file

@ -17,7 +17,7 @@ export interface LoginActionState {
export const login = async (
_: LoginActionState,
formData: FormData
formData: FormData,
): Promise<LoginActionState> => {
try {
const validatedData = authFormSchema.parse({
@ -53,7 +53,7 @@ export interface RegisterActionState {
export const register = async (
_: RegisterActionState,
formData: FormData
formData: FormData,
): Promise<RegisterActionState> => {
try {
const validatedData = authFormSchema.parse({

View file

@ -20,12 +20,12 @@ export const {
providers: [
Credentials({
credentials: {},
// biome-ignore lint/suspicious/noExplicitAny: TODO
async authorize({ email, password }: any) {
const users = await getUser(email);
if (users.length === 0) return null;
// biome-ignore lint: Forbidden non-null assertion.
const passwordsMatch = await compare(password, users[0].password!);
// biome-ignore lint/suspicious/noExplicitAny: TODO
if (!passwordsMatch) return null;
return users[0] as any;
},
}),
@ -43,7 +43,6 @@ export const {
token,
}: {
session: ExtendedSession;
// biome-ignore lint/suspicious/noExplicitAny: TODO
token: any;
}) {
if (session.user) {

View file

@ -20,7 +20,7 @@ export default function Page() {
login,
{
status: 'idle',
}
},
);
useEffect(() => {

View file

@ -20,7 +20,7 @@ export default function Page() {
register,
{
status: 'idle',
}
},
);
useEffect(() => {

View file

@ -1,6 +1,6 @@
'use server';
import { CoreMessage, type CoreUserMessage, generateText } from 'ai';
import { type CoreUserMessage, generateText } from 'ai';
import { cookies } from 'next/headers';
import { customModel } from '@/lib/ai';

View file

@ -104,7 +104,7 @@ export async function POST(request: Request) {
}),
execute: async ({ latitude, longitude }) => {
const response = await fetch(
`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m&hourly=temperature_2m&daily=sunrise,sunset&timezone=auto`
`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m&hourly=temperature_2m&daily=sunrise,sunset&timezone=auto`,
);
const weatherData = await response.json();
@ -350,7 +350,7 @@ export async function POST(request: Request) {
content: message.content,
createdAt: new Date(),
};
}
},
),
});
} catch (error) {

View file

@ -16,7 +16,7 @@ const FileSchema = z.object({
['image/jpeg', 'image/png', 'application/pdf'].includes(file.type),
{
message: 'File type should be JPEG, PNG, or PDF',
}
},
),
});
@ -65,7 +65,7 @@ export async function POST(request: Request) {
} catch (error) {
return NextResponse.json(
{ error: 'Failed to process request' },
{ status: 500 }
{ status: 500 },
);
}
}

View file

@ -8,6 +8,7 @@ export async function GET() {
return Response.json('Unauthorized!', { status: 401 });
}
// biome-ignore lint: Forbidden non-null assertion.
const chats = await getChatsByUserId({ id: session.user.id! });
return Response.json(chats);
}

View file

@ -1,4 +1,4 @@
import { CoreMessage } from 'ai';
import { cookies } from 'next/headers';
import { notFound } from 'next/navigation';

View file

@ -51,7 +51,6 @@ export default async function RootLayout({
>
<head>
<script
// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
dangerouslySetInnerHTML={{
__html: THEME_COLOR_SCRIPT,
}}