horprogs / Just-validate

Modern, simple, lightweight (~5kb gzip) form validation library written in Typescript, with no dependencies (no JQuery!). Support a wide range of predefined rules, async, files, dates validation, custom error messages and styles, localization. Support writing custom rules and plugins.

Home Page:https://just-validate.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type '"required"' is not assignable to type 'Rules'

cesarcarmona opened this issue · comments

Hello i have this error
Type '"required"' is not assignable to type 'Rules'

interfaces.d.ts(56, 5): The expected type comes from property 'rule' which is declared here on type 'FieldRuleInterface'

I already investigated but I can't find the error thanks

Hi, you should export Rules directly from 'just-validate' and use it as:

rule: Rules.Required

or

rule: 'required' as Rules