-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix no-unused-vars issues #7315
Conversation
8d78b2e
to
a8b7fa0
Compare
@@ -44,7 +44,7 @@ module.exports = { | |||
'no-unreachable': 1, | |||
// Allows Chai `expect` expressions | |||
'no-unused-expressions': 0, | |||
'no-unused-vars': 1, | |||
'no-unused-vars': 2, |
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.
Because we extend eslint-config-wpcalypso
we can simply remove the line here because it only existed to downgrade from the default error to warning.
@nssw this needs a rebase – a lot of files were moved around (sorry, you weren’t lucky :) ). |
ad4084a
to
3dbef60
Compare
Rebase done. I had already rebased yesterday but I guess this was bound to happen with such a cross-project PR :)
Thanks for the comment @nb ! I was hoping to receive something like this. I haven't left a comment for reviewers about that to avoid anchoring the topic. So: I am not sure about this. On the one hand, I like how leaving not used arguments/variables/etc in some places (signatures for functions that process events, errs/success callbacks where you do not use the arguments, positional variables, etc) documents the code and the expectations, in a manner. On the other hand, I am not sure whether having the exception for those cases could be a source of subtle bugs yet to comprehend or whether it is a bad practice for some other reason. I have chosen the first route, just because, well, I needed to choose one. But I would be equally happy to choose the other if more eyes see this as a code smell somehow. |
I think it’s okay for now. After looking through your changes, the cases when we need to add line-level exception are few enough. I read through the changes and I noticed two more things:
|
c68e6ed
to
c145557
Compare
Remove the rule, as it is already set to error in the config Calypso depends on
Squashing and merging, thanks for working and following up on that @nssw! |
Thanks to you @nb for you patience, the good suggestions and the time you have taken for reviewing this! |
Nice one! We need more tasks like that 👍 |
This PR seeks to resolve all
no-unused-vars
ESLint issues in the codebase. Although useful on its own, it is focused on helping to land #6945Each commit message references the commit where the changes should have been done, as a way to help others to review.
cc @nb
Test live: https://calypso.live/?branch=fix/no-unused-vars