mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 01:07:01 +08:00
Lexical declarations in `case` and `default` clauses are a footgun, since they are visible in the entire switch block, but they only get initialized upon assignment, which only happens if the relevant `case` is actually reached. To ensure that such lexical declarations only apply to the current `case` (which is usually the intention), `case` clauses containing them should be wrapped in curly braces to create an explicit block. More information: https://eslint.org/docs/rules/no-case-declarations Change-Id: I63d9341fcd76d4b9ce8281bd0e6573b886577f08 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119685 Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org>