logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.79k stars 1.26k forks source link

Update @vee-validate/valibot valibot version to 0.22.0 #4590

Closed ghost closed 10 months ago

ghost commented 10 months ago

Currently, toTypedSchema returns TS error with valibot@0.22.0:

Code:

import { toTypedSchema } from "@vee-validate/valibot";
import { object, string } from "valibot";

export const schema = toTypedSchema(
  object({
    test: string(),
  })
);

Error:

Argument of type 'ObjectSchema<{ test: StringSchema<string>; }, undefined, { test: string; }>' is not assignable to parameter of type 'BaseSchema | BaseSchemaAsync'.
  Type 'ObjectSchema<{ test: StringSchema<string>; }, undefined, { test: string; }>' is not assignable to type 'BaseSchema'.
    The types returned by '_parse(...)' are incompatible between these types.
      Type 'SchemaResult<{ test: string; }>' is not assignable to type '_ParseResult<any>'.
        Type 'UntypedSchemaResult' is not assignable to type '_ParseResult<any>'.
          Type 'UntypedSchemaResult' is not assignable to type '{ output: any; issues?: undefined; }'.
            Types of property 'issues' are incompatible.
              Type 'Issues' is not assignable to type 'undefined'.ts(2345)
logaretm commented 10 months ago

Upgraded dependencies to latest 0.24 should be up with the next release.