You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
knownMembers (string[]) ... A list of known properties. Use for properties which are defined by Vue.js plugins.
What category of rule is this? (place an "X" next to just one item)
[ ] Enforces code style
[X] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
<template><!-- vue members: aaa --><div><div>{{ aaa + bbb + ccc }}</div><div>{{ i }}</div><!-- "i" is not defined in this scope. --><olv-for="i in 5"><li:key="i">{{ bbb + k}}</li><!-- "k" is not defined in this scope. --></ol></div></template><script>importotherfrom"./other"exportdefault{props: ["bbb"],data(){return{ccc: 1,
...other// hard to know properties in `other`.// You can declare it by `<!-- vue members: aaa -->`-like comments.}}}</script>
The text was updated successfully, but these errors were encountered:
I don't think we'll be able to catch all of the possible cases here. Especially the one with extends where theoretically we'd have to check another component too, and then maybe another and so on and so on. If you already have an idea of how to best implement it @mysticatea please share your thoughts here too :)
@mysticatea I'm going to close this proposition, as I believe it's almost not possible to implement and even if it is - because of the number of different criteria that should be satisfied it will most likely cause some false positives and may cause more harm than good. If you don't agree and have an idea of how to best tackle this, please reopen this issue and share your thoughts :)
Please describe what the rule should do:
no-undef
should report a use of undefined variables in templates.Undefined variables are variables which satisfy all of the following conditions:
$data
,$props
, ...).$event
if it's inv-on
directive.v-for
directive andscope
attributes.data
,computed
,methods
, ...) of the custom component don't include it.<!-- vue members: foo, bar ,baz -->
does not include it.This would be helpful to catch
TypeError
s or typo.Options
knownMembers
(string[]
) ... A list of known properties. Use for properties which are defined by Vue.js plugins.What category of rule is this? (place an "X" next to just one item)
[ ] Enforces code style
[X] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
The text was updated successfully, but these errors were encountered: