Skip to content

Commit 5689c65

Browse files
authored
chore(templates): fix eslint errors in website template (#10752)
1 parent 2d8ff72 commit 5689c65

File tree

31 files changed

+49
-96
lines changed

31 files changed

+49
-96
lines changed

templates/website/eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ const eslintConfig = [
3030
],
3131
},
3232
},
33+
{
34+
ignores: ['.next/'],
35+
},
3336
]
3437

3538
export default eslintConfig

templates/website/postcss.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
export default {
1+
const config = {
22
plugins: {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
66
}
7+
8+
export default config

templates/website/src/Footer/RowLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Header } from '@/payload-types'
33
import { RowLabelProps, useRowLabel } from '@payloadcms/ui'
44

5-
export const RowLabel: React.FC<RowLabelProps> = (props) => {
5+
export const RowLabel: React.FC<RowLabelProps> = () => {
66
const data = useRowLabel<NonNullable<Header['navItems']>[number]>()
77

88
const label = data?.data?.link?.label

templates/website/src/Header/RowLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Header } from '@/payload-types'
33
import { RowLabelProps, useRowLabel } from '@payloadcms/ui'
44

5-
export const RowLabel: React.FC<RowLabelProps> = (props) => {
5+
export const RowLabel: React.FC<RowLabelProps> = () => {
66
const data = useRowLabel<NonNullable<Header['navItems']>[number]>()
77

88
const label = data?.data?.link?.label

templates/website/src/app/(frontend)/next/preview/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { getPayload, type PayloadRequest } from 'payload'
44
import configPromise from '@payload-config'
55
import { CollectionSlug } from 'payload'
66

7-
const payloadToken = 'payload-token'
8-
97
export async function GET(
108
req: Request & {
119
cookies: {
@@ -16,7 +14,6 @@ export async function GET(
1614
},
1715
): Promise<Response> {
1816
const payload = await getPayload({ config: configPromise })
19-
const token = req.cookies.get(payloadToken)?.value
2017
const { searchParams } = new URL(req.url)
2118
const path = searchParams.get('path')
2219
const collection = searchParams.get('collection') as CollectionSlug

templates/website/src/app/(frontend)/next/seed/route.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ import { headers } from 'next/headers'
55

66
export const maxDuration = 60 // This function can run for a maximum of 60 seconds
77

8-
export async function POST(
9-
req: Request & {
10-
cookies: {
11-
get: (name: string) => {
12-
value: string
13-
}
14-
}
15-
},
16-
): Promise<Response> {
8+
export async function POST(): Promise<Response> {
179
const payload = await getPayload({ config })
1810
const requestHeaders = await headers()
1911

templates/website/src/app/(frontend)/search/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CollectionArchive } from '@/components/CollectionArchive'
44
import configPromise from '@payload-config'
55
import { getPayload } from 'payload'
66
import React from 'react'
7-
import { Post } from '@/payload-types'
87
import { Search } from '@/search/Component'
98
import PageClient from './page.client'
109
import { CardPostData } from '@/components/Card'

templates/website/src/blocks/Form/Checkbox/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@ import { Width } from '../Width'
1212

1313
export const Checkbox: React.FC<
1414
CheckboxField & {
15-
errors: Partial<
16-
FieldErrorsImpl<{
17-
[x: string]: any
18-
}>
19-
>
20-
getValues: any
15+
errors: Partial<FieldErrorsImpl>
2116
register: UseFormRegister<FieldValues>
22-
setValue: any
2317
}
2418
> = ({ name, defaultValue, errors, label, register, required, width }) => {
2519
const props = register(name, { required: required })

templates/website/src/blocks/Form/Component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export const FormBlock: React.FC<
142142
{formFromProps &&
143143
formFromProps.fields &&
144144
formFromProps.fields?.map((field, index) => {
145+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
145146
const Field: React.FC<any> = fields?.[field.blockType as keyof typeof fields]
146147
if (Field) {
147148
return (

templates/website/src/blocks/Form/Country/index.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CountryField } from '@payloadcms/plugin-form-builder/types'
2-
import type { Control, FieldErrorsImpl, FieldValues } from 'react-hook-form'
2+
import type { Control, FieldErrorsImpl } from 'react-hook-form'
33

44
import { Label } from '@/components/ui/label'
55
import {
@@ -18,12 +18,8 @@ import { countryOptions } from './options'
1818

1919
export const Country: React.FC<
2020
CountryField & {
21-
control: Control<FieldValues, any>
22-
errors: Partial<
23-
FieldErrorsImpl<{
24-
[x: string]: any
25-
}>
26-
>
21+
control: Control
22+
errors: Partial<FieldErrorsImpl>
2723
}
2824
> = ({ name, control, errors, label, required, width }) => {
2925
return (

0 commit comments

Comments
 (0)