vee-validate
vee-validate copied to clipboard
Importing interfaces for vee-validate/rules
What happened?
I'm trying to build a dynamic form generator, using vee-validate, vee-validate/rules along side with vuetify-nuxt
I'm doing my best to restrict any generic or random rules, and stay committed only to the rules that vee-validate/rules provides.
so during my schema building for my generator, I reached out to this point
`import type { VCol } from 'vuetify/components'; import type { all } from '@vee-validate/rules';
interface FieldConfig { is: 'textField' | 'textArea' | 'select' | 'checkbox' | 'slot'; type?: 'text' | 'number' | 'password'; name: string; label: string; rules?: Record<keyof typeof all, any>; cols?: Partial <VCol>; }
export const schema: FieldConfig[] = [ { is: 'VTextField', type: 'text', name: 'username', label: 'username', rules: { required: true, invalidRandomRuleThatShouldTriggerError: 'wefwef', min: 3, }, cols: { md: 12, }, }, ]; `
I expect when defining the "rules" the autocomplet should be working fine and listing all the vee validate rules, also when writing any non-existing rules, the eslint must trigger an error. but both of these expectations not working
Vue.js 3.x and vee-validate 4.x