chore: run lint and prettier on entire codebase

This commit is contained in:
Alessio Gravili
2024-07-11 15:27:01 -04:00
parent f8ab5a9f1e
commit 83fd4c6622
364 changed files with 2578 additions and 2658 deletions

View File

@@ -27,11 +27,11 @@ export const populate = async ({
overrideAccess,
req,
showHiddenFields,
}: Omit<Arguments, 'field'> & {
}: {
collection: Collection
field: Field
id: string
}): Promise<void> => {
} & Omit<Arguments, 'field'>): Promise<void> => {
const dataRef = data as Record<string, unknown>
const doc = await req.payloadDataLoader.load(

View File

@@ -43,14 +43,14 @@ const baseClass = 'rich-text'
declare module 'slate' {
interface CustomTypes {
Editor: BaseEditor & ReactEditor & HistoryEditor
Editor: BaseEditor & HistoryEditor & ReactEditor
Element: ElementNode
Text: TextNode
}
}
const RichTextField: React.FC<
FormFieldBase & {
{
elements: EnabledFeatures['elements']
leaves: EnabledFeatures['leaves']
name: string
@@ -58,7 +58,7 @@ const RichTextField: React.FC<
plugins: RichTextPlugin[]
richTextComponentMap: Map<string, React.ReactNode>
width?: string
}
} & FormFieldBase
> = (props) => {
const {
name,

View File

@@ -1,9 +1,9 @@
import type { Element } from 'slate'
export type LinkElementType = Element & {
export type LinkElementType = {
doc: Record<string, unknown>
fields: Record<string, unknown>
linkType: string
newTab: boolean
url: string
}
} & Element

View File

@@ -27,10 +27,10 @@ const initialParams = {
depth: 0,
}
type Props = FormFieldBase & {
type Props = {
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
} & FormFieldBase
const RelationshipElement: React.FC<Props> = () => {
const {

View File

@@ -1,8 +1,8 @@
import type { Element } from 'slate'
export type RelationshipElementType = Element & {
export type RelationshipElementType = {
relationTo: string
value: {
id: number | string
} | null
}
} & Element

View File

@@ -29,10 +29,10 @@ import { uploadFieldsSchemaPath } from '../../shared.js'
export const UploadDrawer: React.FC<{
drawerSlug: string
element: UploadElementType
fieldProps: FormFieldBase & {
fieldProps: {
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
} & FormFieldBase
relatedCollection: ClientCollectionConfig
schemaPath: string
}> = (props) => {

View File

@@ -33,12 +33,12 @@ const initialParams = {
depth: 0,
}
type Props = FormFieldBase & {
type Props = {
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
} & FormFieldBase
const UploadElement: React.FC<Props & { enabledCollectionSlugs?: string[] }> = ({
const UploadElement: React.FC<{ enabledCollectionSlugs?: string[] } & Props> = ({
enabledCollectionSlugs,
}) => {
const {

View File

@@ -1,9 +1,9 @@
import type { Element } from 'slate'
export type UploadElementType = Element & {
export type UploadElementType = {
fields: Record<string, unknown>
relationTo: string
value: {
id: number | string
} | null
}
} & Element

View File

@@ -17,10 +17,10 @@ const RichTextEditor = lazy(() =>
)
export const RichTextField: React.FC<
FormFieldBase & {
{
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
} & FormFieldBase
> = (props) => {
const { richTextComponentMap } = props

View File

@@ -6,10 +6,10 @@ import React from 'react'
type ElementButtonContextType = {
disabled?: boolean
fieldProps: FormFieldBase & {
fieldProps: {
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
} & FormFieldBase
path: string
schemaPath: string
}
@@ -21,9 +21,9 @@ const ElementButtonContext = React.createContext<ElementButtonContextType>({
})
export const ElementButtonProvider: React.FC<
ElementButtonContextType & {
{
children: React.ReactNode
}
} & ElementButtonContextType
> = (props) => {
const { children, ...rest } = props

View File

@@ -9,10 +9,10 @@ type ElementContextType<T> = {
children: React.ReactNode
editorRef: React.MutableRefObject<HTMLDivElement>
element: T
fieldProps: FormFieldBase & {
fieldProps: {
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
} & FormFieldBase
path: string
schemaPath: string
}
@@ -28,9 +28,9 @@ const ElementContext = React.createContext<ElementContextType<Element>>({
})
export const ElementProvider: React.FC<
ElementContextType<Element> & {
{
childNodes: React.ReactNode
}
} & ElementContextType<Element>
> = (props) => {
const { childNodes, children, ...rest } = props

View File

@@ -5,9 +5,9 @@ import type { FormFieldBase } from '@payloadcms/ui'
import React from 'react'
type LeafButtonContextType = {
fieldProps: FormFieldBase & {
fieldProps: {
name: string
}
} & FormFieldBase
path: string
schemaPath: string
}
@@ -19,9 +19,9 @@ const LeafButtonContext = React.createContext<LeafButtonContextType>({
})
export const LeafButtonProvider: React.FC<
LeafButtonContextType & {
{
children: React.ReactNode
}
} & LeafButtonContextType
> = (props) => {
const { children, ...rest } = props

View File

@@ -8,9 +8,9 @@ type LeafContextType = {
attributes: Record<string, unknown>
children: React.ReactNode
editorRef: React.MutableRefObject<HTMLDivElement>
fieldProps: FormFieldBase & {
fieldProps: {
name: string
}
} & FormFieldBase
leaf: string
path: string
schemaPath: string
@@ -27,9 +27,9 @@ const LeafContext = React.createContext<LeafContextType>({
})
export const LeafProvider: React.FC<
LeafContextType & {
{
result: React.ReactNode
}
} & LeafContextType
> = (props) => {
const { children, result, ...rest } = props