mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 08:38:08 -05:00
Update README, finished fixing eslint styling
Update README, finished fixing eslint styling (look at previous commit description for info).
This commit is contained in:
@@ -1838,7 +1838,7 @@ Other Style Guides
|
||||
- [15.4](#comparison--moreinfo) For more information see [Truth Equality and JavaScript](https://javascriptweblog.wordpress.com/2011/02/07/truth-equality-and-javascript/#more-2108) by Angus Croll.
|
||||
|
||||
<a name="comparison--switch-blocks"></a><a name="15.5"></a>
|
||||
- [15.5](#comparison--switch-blocks) Use braces to create blocks in `case` and `default` clauses that contain lexical declarations (e.g. `let`, `const`, `function`, and `class`). eslint rules: [`no-case-declarations`](http://eslint.org/docs/rules/no-case-declarations.html)
|
||||
- [15.5](#comparison--switch-blocks) Use braces to create blocks in `case` and `default` clauses that contain lexical declarations (e.g. `let`, `const`, `function`, and `class`). eslint: [`no-case-declarations`](http://eslint.org/docs/rules/no-case-declarations.html)
|
||||
|
||||
> Why? Lexical declarations are visible in the entire `switch` block but only get initialized when assigned, which only happens when its `case` is reached. This causes problems when multiple `case` clauses attempt to define the same thing.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user