fix(schema): allow untyped keys in nuxt config (#3527)

This commit is contained in:
Daniel Roe 2022-03-07 10:37:01 +00:00 committed by GitHub
parent 398b311ad6
commit 33ffd8be0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,9 @@ import type { ResolvedConfig } from 'c12'
type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> | T[P] } : T type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> | T[P] } : T
/** User configuration in `nuxt.config` file */ /** User configuration in `nuxt.config` file */
export interface NuxtConfig extends DeepPartial<ConfigSchema> { } export interface NuxtConfig extends DeepPartial<ConfigSchema> {
[key: string]: any
}
/** Normalized Nuxt options available as `nuxt.options.*` */ /** Normalized Nuxt options available as `nuxt.options.*` */
export interface NuxtOptions extends ConfigSchema { export interface NuxtOptions extends ConfigSchema {

View File

@ -75,7 +75,6 @@ describe('modules', () => {
defineNuxtConfig({ sampleModule: { enabled: false } }) defineNuxtConfig({ sampleModule: { enabled: false } })
// @ts-expect-error // @ts-expect-error
defineNuxtConfig({ sampleModule: { other: false } }) defineNuxtConfig({ sampleModule: { other: false } })
// @ts-expect-error
defineNuxtConfig({ undeclaredKey: { other: false } }) defineNuxtConfig({ undeclaredKey: { other: false } })
}) })
}) })