Skip to content

Commit 52f86c7

Browse files
authored
chore(templates): fix eslint errors in vercel templates (#10768)
1 parent c562fbf commit 52f86c7

File tree

32 files changed

+50
-140
lines changed

32 files changed

+50
-140
lines changed

.vscode/settings.json

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,9 @@
11
{
22
"npm.packageManager": "pnpm",
33
"editor.defaultFormatter": "esbenp.prettier-vscode",
4-
"[typescript]": {
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
6-
"editor.formatOnSave": true,
7-
"editor.codeActionsOnSave": {
8-
"source.fixAll.eslint": "explicit"
9-
}
10-
},
11-
"[typescriptreact]": {
12-
"editor.defaultFormatter": "esbenp.prettier-vscode",
13-
"editor.formatOnSave": true,
14-
"editor.codeActionsOnSave": {
15-
"source.fixAll.eslint": "explicit"
16-
}
17-
},
18-
"[javascript]": {
19-
"editor.defaultFormatter": "esbenp.prettier-vscode",
20-
"editor.formatOnSave": true,
21-
"editor.codeActionsOnSave": {
22-
"source.fixAll.eslint": "explicit"
23-
}
24-
},
25-
"[json]": {
26-
"editor.defaultFormatter": "esbenp.prettier-vscode",
27-
"editor.formatOnSave": true
28-
},
29-
"[jsonc]": {
30-
"editor.defaultFormatter": "esbenp.prettier-vscode",
31-
"editor.formatOnSave": true
4+
"editor.formatOnSave": true,
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": "explicit"
327
},
338
"editor.formatOnSaveMode": "file",
349
"eslint.rules.customizations": [
@@ -43,12 +18,6 @@
4318
"typescript.tsdk": "node_modules/typescript/lib",
4419
// Load .git-blame-ignore-revs file
4520
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".git-blame-ignore-revs"],
46-
"[javascript][typescript][typescriptreact]": {
47-
"editor.codeActionsOnSave": {
48-
"source.fixAll.eslint": "explicit"
49-
}
50-
},
51-
"files.insertFinalNewline": true,
5221
"jestrunner.jestCommand": "pnpm exec cross-env NODE_OPTIONS=\"--no-deprecation\" node 'node_modules/jest/bin/jest.js'",
5322
"jestrunner.debugOptions": {
5423
"runtimeArgs": ["--no-deprecation"]

templates/with-vercel-postgres/src/migrations/20250114_010454_initial.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-vercel-postgres'
22

3-
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
3+
export async function up({ db }: MigrateUpArgs): Promise<void> {
44
await db.execute(sql`
55
CREATE TABLE IF NOT EXISTS "users" (
66
"id" serial PRIMARY KEY NOT NULL,
@@ -126,7 +126,7 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
126126
CREATE INDEX IF NOT EXISTS "payload_migrations_created_at_idx" ON "payload_migrations" USING btree ("created_at");`)
127127
}
128128

129-
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
129+
export async function down({ db }: MigrateDownArgs): Promise<void> {
130130
await db.execute(sql`
131131
DROP TABLE "users" CASCADE;
132132
DROP TABLE "media" CASCADE;

templates/with-vercel-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/with-vercel-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/with-vercel-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/with-vercel-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/with-vercel-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/with-vercel-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/with-vercel-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]
146147
if (Field) {
147148
return (

templates/with-vercel-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)