adonisjs / validator

Schema based validator for AdonisJS
MIT License
115 stars 40 forks source link

Property 'alphaNum' does not exist on type 'Rules'. #152

Closed finestgecko closed 2 years ago

finestgecko commented 2 years ago

I am trying to use rules.alphaNum() (see docs) but I get this error:

Property 'alphaNum' does not exist on type 'Rules'.

Package version

AdonisJS 5.8.5

Node.js and npm version

Node.js v16.15.0 NPM v8.5.5

Sample Code (to reproduce the issue)

const validated = await request.validate({
    schema: schema.create({
         code: schema.string([rules.alphaNum()])
    }),
    messages: {},
 })
thetutlage commented 2 years ago

Seems like the docs got published before the actual implementation. I have just made a release, so please update the @adonisjs/core to 5.8.6