add prettier lint rule
This commit is contained in:
@ -16,7 +16,7 @@ const server = z.object({
|
||||
// Since NextAuth.js automatically uses the VERCEL_URL if present.
|
||||
(str) => process.env.VERCEL_URL ?? str,
|
||||
// VERCEL_URL doesn't include `https` so it cant be validated as a URL
|
||||
process.env.VERCEL ? z.string().min(1) : z.string().url(),
|
||||
process.env.VERCEL ? z.string().min(1) : z.string().url()
|
||||
),
|
||||
// Add `.min(1) on ID and SECRET if you want to make sure they're not empty
|
||||
DISCORD_CLIENT_ID: z.string(),
|
||||
@ -70,7 +70,7 @@ if (!!process.env.SKIP_ENV_VALIDATION == false) {
|
||||
if (parsed.success === false) {
|
||||
console.error(
|
||||
"❌ Invalid environment variables:",
|
||||
parsed.error.flatten().fieldErrors,
|
||||
parsed.error.flatten().fieldErrors
|
||||
);
|
||||
throw new Error("Invalid environment variables");
|
||||
}
|
||||
@ -84,7 +84,7 @@ if (!!process.env.SKIP_ENV_VALIDATION == false) {
|
||||
throw new Error(
|
||||
process.env.NODE_ENV === "production"
|
||||
? "❌ Attempted to access a server-side environment variable on the client"
|
||||
: `❌ Attempted to access server-side environment variable '${prop}' on the client`,
|
||||
: `❌ Attempted to access server-side environment variable '${prop}' on the client`
|
||||
);
|
||||
return target[/** @type {keyof typeof target} */ (prop)];
|
||||
},
|
||||
|
Reference in New Issue
Block a user