- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 679
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
New Add vue/no-potential-property-typo
rule
#1072
New Add vue/no-potential-property-typo
rule
#1072
Conversation
i make a new rule , export default {
// ok
data() {
},
// ok , this maybe a custom property
testtt: {},
// bad, this is more likely to be a typo
method: {}
} |
Hi @IWANABETHATGUY. I like a rule to have users set a whitelist and report non-whitelist properties. e.g. https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards I like to list similar names in the whitelist as a suggestion to fix the wrong property. What do you think? |
export default {
dat() {},
method: {},
comput: {},
filter: {}
} we default the threshold is 1, only the option in code is very similar but not a vue built-in option will report. we don't check the inner property, so i think this is safe for user; |
I think people want to detect invalid properties. (The cause of the invalid property may be a typo.) I agree that define a component option whitelist is difficult. (Sorry if you don't communicate well because I don't understand English well.) |
bacuase the indent, the test case is pretty ugly, do you have some good idea for this? and do i need more test case for this rule? |
Hi @IWANABETHATGUY! |
@ota-meshi could you please help for review |
vue/no-potential-property-typo
rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.
I have change requests.
i still have a change request, but i have some question, could please give me some tips? |
I want you to add a test case that can verify that all of the names defined in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! thank you!
#922