mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor: 🚨 Turn every linter rule on and fix issues (there were a LOT :3)
This commit is contained in:
parent
2e98859153
commit
a1e02d0d78
177 changed files with 1826 additions and 1248 deletions
|
|
@ -3,7 +3,7 @@ import { z } from "zod";
|
|||
import { ADMIN_ROLES, DEFAULT_ROLES, RolePermissions } from "~/drizzle/schema";
|
||||
|
||||
export enum MediaBackendType {
|
||||
LOCAL = "local",
|
||||
Local = "local",
|
||||
S3 = "s3",
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ export const configValidator = z.object({
|
|||
.object({
|
||||
backend: z
|
||||
.nativeEnum(MediaBackendType)
|
||||
.default(MediaBackendType.LOCAL),
|
||||
.default(MediaBackendType.Local),
|
||||
deduplicate_media: z.boolean().default(true),
|
||||
local_uploads_folder: z.string().min(1).default("uploads"),
|
||||
conversion: z
|
||||
|
|
@ -234,7 +234,7 @@ export const configValidator = z.object({
|
|||
}),
|
||||
})
|
||||
.default({
|
||||
backend: MediaBackendType.LOCAL,
|
||||
backend: MediaBackendType.Local,
|
||||
deduplicate_media: true,
|
||||
local_uploads_folder: "uploads",
|
||||
conversion: {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*/
|
||||
|
||||
import { loadConfig, watchConfig } from "c12";
|
||||
import chalk from "chalk";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { type Config, configValidator } from "./config.type";
|
||||
|
||||
const { config } = await watchConfig({
|
||||
|
|
@ -23,21 +21,6 @@ const { config } = await watchConfig({
|
|||
const parsed = await configValidator.safeParseAsync(config);
|
||||
|
||||
if (!parsed.success) {
|
||||
console.log(
|
||||
`${chalk.bgRed.white(
|
||||
" CRITICAL ",
|
||||
)} There was an error parsing the config file at ${chalk.bold(
|
||||
"./config/config.toml",
|
||||
)}. Please fix the file and try again.`,
|
||||
);
|
||||
console.log(
|
||||
`${chalk.bgRed.white(
|
||||
" CRITICAL ",
|
||||
)} Follow the installation intructions and get a sample config file from the repository if needed.`,
|
||||
);
|
||||
console.log(
|
||||
`${chalk.bgRed.white(" CRITICAL ")} ${fromError(parsed.error).message}`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue