- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 681
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 no-use-computed-property-like-method rules #1234
New: add no-use-computed-property-like-method rules #1234
Conversation
d1fe2a1
to
6b0b860
Compare
Sorry for my slow work😭 |
@ota-meshi |
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 posted some comments.
This reverts commit 8b825e5.
</script> | ||
` | ||
} | ||
], |
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.
I have found an error in some cases. Could you add the following test cases?
<script>
export default {
computed: {
bar() {
return
}
}
}
</script>
<script>
export default {
methods: {
fn() {
this.foo()
}
}
}
</script>
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.
Thanks!
I'll do that :)
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.
@ota-meshi
I changed some codes to support the above cases.
3b77c4e
ce93fa6
However, I will not support this case:
<script>
export default {
methods: {
fn() {
this.foo()
}
}
}
</script>
Because this rule only checkes whether computed properties are expected as property or not.
In this case, computed is not used.
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.
I don't want support. I've found that using a rule in that source code reports a crash or an incorrect error, so I just want to add test cases to tests if it's okay.
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.
Thanks.
I just make sense of what you said :)
I added test case
7cb18fe
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.
Looks good to me! Thank you!
close #928
This PR adds vue/no-use-computed-property-like-method rule.
https://deploy-preview-1234--eslint-plugin-vue.netlify.app/rules/no-use-computed-property-like-method.html