Closed
Description
When we added syntax support for this with the TS4.4 support, we did not add proper support for scope analysis of this.
Currently scope analysis will "work" because the analyser will just traverse the block body - but it will create an incorrect scope tree because a new scope will not be created for the block scope created by the static block.
Repro
declare function someCondition(): boolean;
class Foo {
static count = 0;
static {
if (someCondition()) {
Foo.count++;
}
}
}
Reference implementation: eslint/eslint-scope#80