Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Typescript type of validator #606

Open
Laityned opened this issue Mar 1, 2024 · 0 comments
Open

fix: Typescript type of validator #606

Laityned opened this issue Mar 1, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Laityned
Copy link

Laityned commented Mar 1, 2024

🐛 The bug
What isn't working? Describe what the bug is.

Currently I try to add a custom validation rule, in shorthand:
validation: (Rule) => Rule.custom((value, context) => true)

Custom Rules, should allow to obtain the context to reference other fields as described:
sanity docs
However, currently it gives an typescript error.

🛠️ To reproduce
Steps to reproduce the behavior:

🌈 Expected behaviour
What did you expect to happen? Is there a section in the docs about this?

Update the typescript definition to be compatible with sanity

ℹ️ Additional context

Thanks in advance

@Laityned Laityned added the bug Something isn't working label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants