-
-
Notifications
You must be signed in to change notification settings - Fork 681
New: add vue/no-unused-properties rule #871
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-unused-properties rule #871
Conversation
Hello, recently we also added properties usage detection when a component instance accessed via a parameter in I'm not yet sure if you're interested in this rule and also it's possible that we'll need to add more updates/fixes in the future, so instead of copying it here every time, I'm inserting a link to a location where you can always find up-to-date codes: https://github.com/learningequality/kolibri/tree/develop/packages/eslint-plugin-kolibri. Also, we have similar rules available for component methods, mapped Vuex state, getters, mutations and actions there. |
We're using |
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.
Good job!
LGTM!
Friendly ping - really looking forward to using this, any idea when it will be merged? |
Friendly ping as well !!! I'm extremely looking forward to this being merged ! |
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 for this PR! I like your idea.
I have some requests.
const scriptVisitor = Object.assign( | ||
{}, | ||
{ | ||
'MemberExpression[object.type="ThisExpression"][property.type="Identifier"][property.name]' ( |
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.
Could you change to support the destructuring assignment?
const {prop} = this
Also could you change to support the track the this
?
I want to support assignment expressions as follows:
const vm = this
vm.prop
Can someone please make the changes requested? Would love to have this part of eslint!! |
Hi, I had already started working on it and then went on a long sick leave. Right now I need to catch up on other tasks I am responsible for so I think I will get to this rather after Christmas. |
Also interested.
|
i have wrote a unofficial eslint plugin for |
@MisRob Would you like some support on this PR? My team is looking forward to this rule so I would be happy to help 👍🏼 |
@ibarsi Hi thanks a lot. I believe I will eventually get to that though this year has been really busy so far. So if you can resolve @ota-meshi requests sooner than I can get back to it, you are more than welcome to do so. I briefly checked what needs to be done but don't have any codes yet. |
Guys, our team is also very much in need of this rule. If someone could get this merged I believe a lot of ppl would be very happy :) |
here is a choice, eslint-plugin-vueunused, the same effect as this pull request , pass all this pr unit test and finish the #871 (comment) feature. |
* New: add vue/no-unused-properties rule (#631) * Update * Updated to trace function calls. Co-authored-by: Michaela Robosova <[email protected]>
Hello,
we've implemented
vue/no-unused-properties
(disallows any unused properties, data and computed properties) as our custom internal rule recently and noticed that there's an accepted rule proposition for this logic already (#631) so we're sharing what we have.Refs: #631