mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 21:38:21 -05:00
This commit adds guidance warning people to avoid lexical declarations in case/default clauses and enables the corresponding ESLint rule. http://eslint.org/docs/rules/no-case-declarations.html We didn't have a section on switch statements yet, so I thought about starting one. It seemed like it would best fit between section 15 (Comparison Operators & Equality) and section 16 (Blocks), but I didn't want to mess up all of the following numberings, since people probably have references to them. I considered adding this near the end to minimize this effect, but it really seemed to belong near these other things. I landed on appending it to Section 15 (Comparison Operators & Equality) and I think it sorta fits there since switch statements are a related concept.