nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.13k stars 627 forks source link

? missing in `experimental` section of the config #2393

Closed arkhaiel closed 1 year ago

arkhaiel commented 1 year ago

Environment

Reproduction

I opened a PR : https://github.com/nuxt/content/pull/2391

If I understand well what's going on, when using typescript.strict: true in nuxt.config.ts, TS raises an error because all three experimental options are set to "required" instead of optional.

in nuxt.config.ts :

content: {
    experimental: {
        clientDB: true
    },
}

The error :

Type '{ clientDB: true; }' is missing the following properties from type '{ clientDB: boolean; stripQueryParameters: boolean; advanceQuery: boolean; }': stripQueryParameters, advanceQuery

Describe the bug

Here is a part of the src/module.ts file :

  experimental: {
    clientDB: boolean
    stripQueryParameters: boolean
    advanceQuery: boolean
  }

and I propose to modify like this, so no TS warning anymore :

  experimental: {
    clientDB?: boolean
    stripQueryParameters?: boolean
    advanceQuery?: boolean
  }

Additional context

No response

Logs

No response