-
-
Notifications
You must be signed in to change notification settings - Fork 679
Rename and add options to this-in-template
.
#163
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
Conversation
no-this-in-template
.this-in-template
.
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.
Thank you very much!
Almost looks good to me, but I have some concerns.
Could you take a look?
lib/rules/this-in-template.js
Outdated
function validateNever () { | ||
return { | ||
'VExpressionContainer ThisExpression' (node) { | ||
if (options === 'never') { |
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 think that it should check whether variables which have the same name as the property name.
<template>
<div v-for="x of xs">
{{this.x}} <!-- we cannot remove this `this.`. -->
</div>
</template>
Also, I think that it should check whether the this
is MemberExpression#object
.
<template>
<child :parent="this" /> <!-- we cannot remove this `this`. -->
</template>
Incidentally, I have improved
Though, I'm not sure that it helps this rule. |
@mysticatea i i like changes with but for now there is infinite loop there: vuejs/vue-eslint-parser#16 suggestions applied |
Thank you! I'm sorry, I have realized one more thing. If property name is a reserved word (e.g. |
@mysticatea check for js reserved names added |
additionality i added support for |
@mysticatea with latest change to parser, reference variables are no longer there Sent from my Xiaomi Redmi 4A using FastHub |
I'm sorry for late.
Good catch!
I think, in fact, |
GJ! I'll release it at the end of this weekend @mysticatea @armano2 . I'm moving to new place, so have quite a lot on my plate lately.. |
fixes #148