From 40d360127a55a1c66420060c4d5aea24965dbbfc Mon Sep 17 00:00:00 2001 From: James Date: Fri, 8 Mar 2024 15:22:02 -0500 Subject: [PATCH] chore: lint --- payload.config.ts | 81 ++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/payload.config.ts b/payload.config.ts index 34a475b..5f740e6 100644 --- a/payload.config.ts +++ b/payload.config.ts @@ -1,55 +1,64 @@ import path from "path"; // import { postgresAdapter } from '@payloadcms/db-postgres' import { - AlignFeature, BlockQuoteFeature, - BlocksFeature, BoldFeature, CheckListFeature, HeadingFeature, IndentFeature, InlineCodeFeature, ItalicFeature, + AlignFeature, + BlockQuoteFeature, + BlocksFeature, + BoldFeature, + CheckListFeature, + HeadingFeature, + IndentFeature, + InlineCodeFeature, + ItalicFeature, lexicalEditor, - LinkFeature, OrderedListFeature, + LinkFeature, + OrderedListFeature, ParagraphFeature, - RelationshipFeature, UnorderedListFeature, + RelationshipFeature, + UnorderedListFeature, UploadFeature, -} from '@payloadcms/richtext-lexical' +} from "@payloadcms/richtext-lexical"; //import { slateEditor } from '@payloadcms/richtext-slate' import { mongooseAdapter } from "@payloadcms/db-mongodb"; import { buildConfig } from "payload/config"; -import sharp from 'sharp' +import sharp from "sharp"; import { fileURLToPath } from "url"; -const filename = fileURLToPath(import.meta.url) -const dirname = path.dirname(filename) +const filename = fileURLToPath(import.meta.url); +const dirname = path.dirname(filename); export default buildConfig({ //editor: slateEditor({}), - editor: lexicalEditor(), + editor: lexicalEditor(), collections: [ { - slug: 'pages', + slug: "pages", admin: { - useAsTitle: 'title', + useAsTitle: "title", }, fields: [ { - name: 'title', - type: 'text', + name: "title", + type: "text", }, { - name: 'content', - type: 'richText', - } - ] + name: "content", + type: "richText", + }, + ], }, { - slug: 'media', + slug: "media", upload: true, fields: [ { - name: 'text', - type: 'text', - } - ] - } + name: "text", + type: "text", + }, + ], + }, ], - secret: process.env.PAYLOAD_SECRET || '', + secret: process.env.PAYLOAD_SECRET || "", typescript: { outputFile: path.resolve(dirname, "payload-types.ts"), }, @@ -59,33 +68,33 @@ export default buildConfig({ // } // }), db: mongooseAdapter({ - url: process.env.MONGODB_URI || '', + url: process.env.MONGODB_URI || "", }), admin: { autoLogin: { - email: 'dev@payloadcms.com', - password: 'test', + email: "dev@payloadcms.com", + password: "test", prefillOnly: true, - } + }, }, async onInit(payload) { const existingUsers = await payload.find({ - collection: 'users', + collection: "users", limit: 1, - }) + }); if (existingUsers.docs.length === 0) { await payload.create({ - collection: 'users', + collection: "users", data: { - email: 'dev@payloadcms.com', - password: 'test', - } - }) + email: "dev@payloadcms.com", + password: "test", + }, + }); } }, // Sharp is now an optional dependency - - // if you want to resize images, crop, set focal point, etc. + // if you want to resize images, crop, set focal point, etc. // make sure to install it and pass it to the config. // This is temporary - we may make an adapter pattern