Skip to content

Commit

Permalink
ignore config-schema errors
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 5, 2024
1 parent 37d7b3e commit 604df57
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/next/src/server/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const zSizeLimit = z.custom<SizeLimit>((val) => {
return false
})

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zExportMap: zod.ZodType<ExportPathMap> = z.record(
z.string(),
z.object({
Expand All @@ -37,6 +38,7 @@ const zExportMap: zod.ZodType<ExportPathMap> = z.record(
})
)

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zRouteHas: zod.ZodType<RouteHas> = z.union([
z.object({
type: z.enum(['header', 'query', 'cookie']),
Expand All @@ -50,6 +52,7 @@ const zRouteHas: zod.ZodType<RouteHas> = z.union([
}),
])

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zRewrite: zod.ZodType<Rewrite> = z.object({
source: z.string(),
destination: z.string(),
Expand All @@ -60,6 +63,7 @@ const zRewrite: zod.ZodType<Rewrite> = z.object({
internal: z.boolean().optional(),
})

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zRedirect: zod.ZodType<Redirect> = z
.object({
source: z.string(),
Expand All @@ -83,6 +87,7 @@ const zRedirect: zod.ZodType<Redirect> = z
])
)

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zHeader: zod.ZodType<Header> = z.object({
source: z.string(),
basePath: z.literal(false).optional(),
Expand All @@ -94,6 +99,7 @@ const zHeader: zod.ZodType<Header> = z.object({
internal: z.boolean().optional(),
})

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zTurboLoaderItem: zod.ZodType<TurboLoaderItem> = z.union([
z.string(),
z.object({
Expand All @@ -103,6 +109,7 @@ const zTurboLoaderItem: zod.ZodType<TurboLoaderItem> = z.union([
}),
])

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
const zTurboRule: zod.ZodType<TurboRuleConfigItemOrShortcut> = z.union([
z.array(zTurboLoaderItem),
z.object({
Expand All @@ -111,6 +118,7 @@ const zTurboRule: zod.ZodType<TurboRuleConfigItemOrShortcut> = z.union([
}),
])

// @ts-ignore ts check incompatible due to `strictNullChecks: false`
export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
z.strictObject({
amp: z
Expand Down

0 comments on commit 604df57

Please sign in to comment.