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: block-scoped-var
issues (fixes #2253, fixes #2747)
#3126
Conversation
Oops, this implement is checking |
👍 |
f2dfa44
to
9d17ddb
Compare
OK, ready for review.
I found this rule is not emulating behaviors |
This test case make this rule ignore a switch block, why is that? |
Looks like a bug to me. |
Why is that a bug? Switch statements create a block but case statements do not. |
@nzakas There's a reference outside the switch. |
That also looks like a bug. Switch statements do make a block. |
I found: http://www.ecma-international.org/ecma-262/6.0/#sec-switch-statement-runtime-semantics-evaluation Yeah, switch statement should make a block. |
9d17ddb
to
f857cde
Compare
I modified a bit for switch statement. The diff is here: mysticatea@cc1af6c |
@michaelficarra ah, right you are. Thanks, completely missed that. |
f857cde
to
6a77f79
Compare
cae0f5c
to
47ed64f
Compare
I added tests for #2967. And my misunderstanding was corrected in #3158, so I removed a logic which allows multiple blocks (e.g. I have a question.
For example:
I guess the warnings can be removed. |
Coverage decreased.... but |
this is new. I have never seen coveralls to display here. |
47ed64f
to
1c55e95
Compare
When the tests of node |
I complement my question. It needs to rewrite some tests in order to remove the duplicate warnings of |
The function can be removed, but you should create a separate issue and pull request because it's a breaking change. |
OK, thank you. So this PR is ready for review again. |
LGTM |
I remade the rule with using escope.