-
Notifications
You must be signed in to change notification settings - Fork 715
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
Add eslint rule to find unused properties, data and computed properties #5347
Add eslint rule to find unused properties, data and computed properties #5347
Conversation
Those constants are referenced directly, they're actually not used as a component instance data.
that are needed for TODO template commented out code.
Codecov Report
|
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.
This is excellent. My read through of the code changes and the linting code make me think this is definitely close to mergeable, but as you suggest, I will also try to break it myself!
@@ -79,6 +79,7 @@ | |||
group() { | |||
return this.groupMap[this.$route.params.groupId]; | |||
}, | |||
/** TODO COACH |
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.
This looks unfinished?
@@ -93,6 +93,7 @@ | |||
components: {}, | |||
mixins: [commonCoach], | |||
computed: { | |||
/** TODO COACH |
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.
Ditto.
packages/eslint-plugin-kolibri/lib/rules/vue-no-unused-properties.js
Outdated
Show resolved
Hide resolved
awesome!
One thing to check for is that many of the users of these components will still be passing in the props. For example, we deleted
We had a related conversation a little while go. The general pattern is that some
There are lots of these scattered around the code base. I don't think the inconsistency has caused us any particular issues, but might be nice to standardize on a strategy.
I think some of these relate to some 0.12.y coach tools work @jonboiser is working on. @jonboiser would you mind checking if any of these are actually dead code that should be removed? |
- id, contentId, channelId - related AssessmentWrapper and its parent (ContentPage) cleanup
Thanks for info Devon!
Right, I didn't realize I should also clean this, thanks. It's done in the last four commits.
OK. It was used only in the script part here but I guess it will be better to keep it consistent and prepared for usage in templates so I moved those constants I removed before back to an instance and referenced them using |
all right, that's cool. The way you had it before also seemed fine though |
No problem, I don't have any strong opinion on this particular issue and if this is a general tendency ;) |
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'm gonna go ahead and merge this to prevent merge conflicts.
@jonboiser when you get back, could you follow up on the 'TODO' items and flag if there are any that won't be addressed by your work on coach tools?
This is great!! Are there any plans to add this to eslint-plugin-vue? Could an update be pushed to NPM so we can use these rules via eslint-plugin-kolibri? |
Hello, we opened a PR in |
Summary
Before
After
Reviewer guidance
055bfc3 , though I would appreciate if someone had a look
this
. I guess there's no need to save them to an instance and it's also a bit more visible that they are some common definitions and constants, but I don't have any preference so if someone prefers the second solution, no problem.References
Partially solves #4992.
As discussed in #4992, as soon as it's ready, I would like to open the rule PR directly in eslint-plugin-vue repo where there's already an issue for this rule opened and proposal accepted.
Contributor Checklist
PR process:
Testing:
Reviewer Checklist
yarn
andpip
)