Describe the bug
when adding a new custom validator, for example a string validator that validates a BSON id, it's simple to extend StringSchema. However, because of the way that the locale object is defined using typeof (https://github.com/jquense/yup/blob/master/src/locale.ts#L156) it is not possible to extend its type to allow localizing error messages for that new validator.
To Reproduce
make a .d.ts file and put it in a path where TS will pick it up. Attempt to override the locale
I wouldn't override the yup types, since yup doesn't know about your additions anyway, instead i'd just extend the type locally and you can use your MyAppLocale extends Locale in your custom tests
Describe the bug when adding a new custom validator, for example a string validator that validates a BSON id, it's simple to extend
StringSchema
. However, because of the way that the locale object is defined usingtypeof
(https://github.com/jquense/yup/blob/master/src/locale.ts#L156) it is not possible to extend its type to allow localizing error messages for that new validator.To Reproduce
make a
.d.ts
file and put it in a path where TS will pick it up. Attempt to override the localeExpected behavior
It should be possible to override these types
Platform (please complete the following information): all
Additional context