Unverified Commit b7c2bd10 authored by Chase Adams's avatar Chase Adams Committed by GitHub

fix meaninglessFileNames type in compiler options schema (#39698)

# Bug 

I would assume that this should be generated from TypeScript, but based on the [original PR](https://github.com/vercel/next.js/pull/38498/files) it wasn't clear that there was a way to generate these automatically.

Fixes the type of `styledComponents. topLevelImportPaths` and `styledComponents.meaninglessFileNames` so that it matches the [TypeScript type](https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L457).

This was causing a warning here:

```
warn  - Invalid next.config.js options detected: 
  - The value at .compiler.styledComponents must be a boolean but it was an object.
  - The value at .compiler.styledComponents.meaninglessFileNames must be a boolean but it was an array.
  - The value at .compiler.styledComponents must match exactly one schema in oneOf.
 ```

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
Co-authored-by: 's avatarchaseadamsio <103162876+chaseadamsio@users.noreply.github.com>
parent bc4d98af
...@@ -111,11 +111,16 @@ const configSchema = { ...@@ -111,11 +111,16 @@ const configSchema = {
type: 'boolean', type: 'boolean',
}, },
topLevelImportPaths: { topLevelImportPaths: {
type: 'array', oneOf: [
items: { { type: 'boolean' },
type: 'string', {
minLength: 1, type: 'array',
}, items: {
type: 'string',
minLength: 1,
},
},
],
}, },
ssr: { ssr: {
type: 'boolean', type: 'boolean',
...@@ -124,7 +129,16 @@ const configSchema = { ...@@ -124,7 +129,16 @@ const configSchema = {
type: 'boolean', type: 'boolean',
}, },
meaninglessFileNames: { meaninglessFileNames: {
type: 'boolean', oneOf: [
{ type: 'boolean' },
{
type: 'array',
items: {
type: 'string',
minLength: 1,
},
},
],
}, },
minify: { minify: {
type: 'boolean', type: 'boolean',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment