--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.ts --- # Input ```ts interface Foo {} class Foo {} class Foo2 {} interface Foo2 {} function f(){ interface Foo3 {} class Foo3 {} } { interface Foo4 {} class Foo4 {} } export {} ``` # Diagnostics ``` invalid.ts:2:7 lint/suspicious/noUnsafeDeclarationMerging ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This class is unsafely merged with an interface. 1 │ interface Foo {} > 2 │ class Foo {} │ ^^^ 3 │ 4 │ class Foo2 {} i The interface is declared here. > 1 │ interface Foo {} │ ^^^ 2 │ class Foo {} 3 │ i The TypeScript compiler doesn't check whether properties defined in the interface are initialized in the class. ``` ``` invalid.ts:4:7 lint/suspicious/noUnsafeDeclarationMerging ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This class is unsafely merged with an interface. 2 │ class Foo {} 3 │ > 4 │ class Foo2 {} │ ^^^^ 5 │ interface Foo2 {} 6 │ i The interface is declared here. 4 │ class Foo2 {} > 5 │ interface Foo2 {} │ ^^^^ 6 │ 7 │ function f(){ i The TypeScript compiler doesn't check whether properties defined in the interface are initialized in the class. ``` ``` invalid.ts:9:11 lint/suspicious/noUnsafeDeclarationMerging ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This class is unsafely merged with an interface. 7 │ function f(){ 8 │ interface Foo3 {} > 9 │ class Foo3 {} │ ^^^^ 10 │ } 11 │ i The interface is declared here. 7 │ function f(){ > 8 │ interface Foo3 {} │ ^^^^ 9 │ class Foo3 {} 10 │ } i The TypeScript compiler doesn't check whether properties defined in the interface are initialized in the class. ``` ``` invalid.ts:14:11 lint/suspicious/noUnsafeDeclarationMerging ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This class is unsafely merged with an interface. 12 │ { 13 │ interface Foo4 {} > 14 │ class Foo4 {} │ ^^^^ 15 │ } 16 │ i The interface is declared here. 12 │ { > 13 │ interface Foo4 {} │ ^^^^ 14 │ class Foo4 {} 15 │ } i The TypeScript compiler doesn't check whether properties defined in the interface are initialized in the class. ```