esLint里no-case-declarations的意义在哪
官网的解释：The reason is that the lexical declaration is visible in the entire switch block but it only gets initialized when it is assigned, which will only happen if the case where it is defined is reached.
没怎么看懂
有中文网站 no-case-declarations
为了保证词法声明语句只在当前 `case` 语句中有效，将你子句包裹在块中。  
该规则旨在避免访问未经初始化的词法绑定以及跨 `case` 语句访问被提升的函数。
```
switch (foo) {
    case 1:
        let x = 1;
        break;
    case 2:
        const y = 2;
        break;
    case 3:
        function f() {}
        break;
    default:
        class C {}
}
```
大概是指上面`case 1`里的`x`在`case 2`里也会生效，所以要用`{}`包起来，防止`x`提升到整个`switch`语句。