-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Invalid key "modify" in validation rules object for prop #7279
Comments
I think the question is what you are doing in that plugin. It makes little sense to me to add additional properies there... |
Hi all, The issue is definitely a breaking change. It is caused by this pull request and is already broken lots of cases. So far it was completely ok to add a custom property to a 'prop' that can be used later for some custom transformations or actions. The documentation is also not saying anything against such customization. Trading spell checking for loosing such flexibility of the framework seems quite odd to me. I would rather leave such spelling checks for some static code analysis tools. In case this change is a must, one possible solution is adding some concrete custom property for such cases that can be used besides 'type', 'default', 'required' and 'validation'. Greetings, |
That seems something like |
IMHO the prop is a plain JavaScript object that can take any possible abstraction, thus, any custom fields that can possibly serve a more advanced logic in the Vue component. Indeed, it is dedicated to serve the purpose of the Vue framework, but still this is an object and having a different property inside is not a mistake that should be thrown as an exception. Warning, possibly yes, but not a JavaScript exception. There are many possible cases that these errors can cause more troubles than actually help in case of a typo. Here you are some examples:
|
Reverting the warning, since this is causing issues for existing use cases, and the strict validation can still be applied by opting into tools like eslint plugins or TypeScript. |
Version
2.5.11
Reproduction link
https://jsfiddle.net/2v8pr5he/
Steps to reproduce
I'm getting the following warning:
while defining a prop like this:
while I know that
modify
is not a standard property in vue, it is used by my vue plugin. Is there some way I can disable this warning or change the validation rules for props?What is expected?
Ideally there should be a way to disable this specific warning.
What is actually happening?
No such way currently.
The text was updated successfully, but these errors were encountered: