summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bluwy <bluwy@users.noreply.github.com> 2023-05-18 09:42:07 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2023-05-18 09:42:07 +0000
commit28d4d22f7bc4e90c38dbcbba1873d4827aa0d688 (patch)
tree54b7965320ac75e2347fafa6af9bfd9bb13ec3b5
parentcada10a466f81f8edb0aa664f9cffdb6b5b8f307 (diff)
downloadastro-28d4d22f7bc4e90c38dbcbba1873d4827aa0d688.tar.gz
astro-28d4d22f7bc4e90c38dbcbba1873d4827aa0d688.tar.zst
astro-28d4d22f7bc4e90c38dbcbba1873d4827aa0d688.zip
[ci] format
-rw-r--r--packages/astro/src/core/config/schema.ts29
1 files changed, 18 insertions, 11 deletions
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index afb49c053..dd21289cc 100644
--- a/packages/astro/src/core/config/schema.ts
+++ b/packages/astro/src/core/config/schema.ts
@@ -210,17 +210,24 @@ export const AstroConfigSchema = z.object({
middleware: z.oboolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.middleware),
hybridOutput: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.hybridOutput),
})
- .passthrough()
- .refine(d => {
- const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental)
- const invalidKeys = Object.keys(d).filter(key => !validKeys.includes(key))
- if (invalidKeys.length > 0) return false
- return true
- }, d => {
- const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental)
- const invalidKeys = Object.keys(d).filter(key => !validKeys.includes(key))
- return { message: `Invalid experimental key: \`${invalidKeys.join(', ')}\`. \nMake sure the spelling is correct, and that your Astro version supports this experiment.\nSee https://docs.astro.build/en/reference/configuration-reference/#experimental-flags for more information.` };
- })
+ .passthrough()
+ .refine(
+ (d) => {
+ const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental);
+ const invalidKeys = Object.keys(d).filter((key) => !validKeys.includes(key));
+ if (invalidKeys.length > 0) return false;
+ return true;
+ },
+ (d) => {
+ const validKeys = Object.keys(ASTRO_CONFIG_DEFAULTS.experimental);
+ const invalidKeys = Object.keys(d).filter((key) => !validKeys.includes(key));
+ return {
+ message: `Invalid experimental key: \`${invalidKeys.join(
+ ', '
+ )}\`. \nMake sure the spelling is correct, and that your Astro version supports this experiment.\nSee https://docs.astro.build/en/reference/configuration-reference/#experimental-flags for more information.`,
+ };
+ }
+ )
.optional()
.default({}),
legacy: z.object({}).optional().default({}),