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
Docs: Improve examples for no-case-declarations (fixes #6716) #7920
Conversation
@rangelke, thanks for your PR! By analyzing the history of the files in this pull request, we identified @arv, @pedrottimark and @scriptdaemon to be potential reviewers. |
LGTM |
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.
LGTM
For the title I think something shorter like "Improve examples for no-case-declarations" would work.
@@ -39,7 +39,11 @@ Examples of **correct** code for this rule: | |||
/*eslint no-case-declarations: "error"*/ | |||
/*eslint-env es6*/ | |||
|
|||
/* Declarations outside switch-statements are valid */ |
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.
By looking at other example code I think it is more common to use //
comments.
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'll update!
LGTM |
@arv The appveyor build failed, could it be because of the name change of my commit? |
@rangelke Thanks, this looks good! The appveyor build is green, maybe it just wasn't finished yet when you checked. |
What is the purpose of this pull request? (put an "X" next to item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
PR for the following issue #6716
What changes did you make? (Give an overview)
I added two examples where no-case-declarations are used correctly, one declaration outside the switch-statement and one using var.
The first the block scope of a case is introduced I added a comment to make it clearer where brackets should be used.
Is there anything you'd like reviewers to focus on?
I have troubles with an appropriate commit message. Is it too vague? If so, any proposals, since it's hard to keep in the 72 character limit?