plantain-00/type-coverage

Incompatibility with zod schemas

Closed this issue · 2 comments

First of all thanks for the awesome library, this truly helps us to achieve high quality in our TS projects.

Version: v2.27.1

Environment: Windows and Linux

Code:

const someSchema = z.object({
  someArray: z.array(
    z.object({
      value: z.boolean(),
    }),
  ),
})

This simple zod schema will report 2 errors that the type contains any. See:
image
Indeed the type definition from zod has "strip ZodTypeAny", but that means exactly that any isn't allowed.

Expected:

No error due to the zod schema being defined

Actual:

Errors whenever using zod, thus we resort to the annoying:
image

If there would be a workaround it would be super cool

it's any is in type arguments, you.can ignore them by --ignore-nested

Thanks so much for the prompt feedback @plantain-00 :)