-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
no-lone-blocks does not check statements in switch cases #8047
Closed
not-an-aardvark opened this issue
Feb 8, 2017
· 1 comment
· Fixed by renovatebot/renovate#111 · May be fixed by iamhunter/teammates#4
Closed
no-lone-blocks does not check statements in switch cases #8047
not-an-aardvark opened this issue
Feb 8, 2017
· 1 comment
· Fixed by renovatebot/renovate#111 · May be fixed by iamhunter/teammates#4
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
rule
Relates to ESLint's core rules
Comments
not-an-aardvark
added
bug
ESLint is working incorrectly
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
rule
Relates to ESLint's core rules
labels
Feb 8, 2017
not-an-aardvark
added a commit
that referenced
this issue
Feb 8, 2017
There are currently three types of nodes that can contain a list of statements: * `Program` * `BlockStatement` * `SwitchCase` Several rules have to check for these node types, and sometimes they do it incorrectly (see #8047). This commit puts the node types in a constant in `ast-utils`.
not-an-aardvark
added a commit
that referenced
this issue
Feb 8, 2017
There are currently three types of nodes that can contain a list of statements: * `Program` * `BlockStatement` * `SwitchCase` Several rules have to check for these node types, and sometimes they do it incorrectly (see #8047). This commit puts the node types in a constant in `ast-utils`.
not-an-aardvark
added a commit
that referenced
this issue
Feb 10, 2017
not-an-aardvark
added a commit
that referenced
this issue
Feb 13, 2017
This was referenced Feb 20, 2017
pantosha
pushed a commit
to pantosha/eslint
that referenced
this issue
Feb 21, 2017
Please make this configurable. I want to consistently use blocks in all cases of switch statements that use |
eslint-deprecated
bot
added
the
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Feb 6, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
rule
Relates to ESLint's core rules
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
I expected an error to be reported.
What actually happened? Please include the actual, raw output from ESLint.
No error was reported.
I know that it's fairly common to enclose an entire switch case in a block, e.g.
So I think the best solution is to report a block in a switch case only if there are other statements in the case.
The text was updated successfully, but these errors were encountered: