From 627dd424cb8dcdbc3db6710ad95f56e3179e448c Mon Sep 17 00:00:00 2001 From: Jose <48152124+JoSeBu1@users.noreply.github.com> Date: Sun, 14 Apr 2024 16:33:59 +0200 Subject: [PATCH] fix(linter/no-empty-interface): add missing test (#2979) As requested add new test https://github.com/oxc-project/oxc/pull/2973#discussion_r1564728188 --------- Co-authored-by: j.buendia --- crates/oxc_linter/src/rules/typescript/no_empty_interface.rs | 1 + crates/oxc_linter/src/snapshots/no_empty_interface.snap | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs b/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs index 0165b3431..88a7be7b5 100644 --- a/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs +++ b/crates/oxc_linter/src/rules/typescript/no_empty_interface.rs @@ -128,6 +128,7 @@ fn test() { let fail = vec![ ("interface Foo {}", None), + ("interface Foo extends {}", None), ( " interface Foo { diff --git a/crates/oxc_linter/src/snapshots/no_empty_interface.snap b/crates/oxc_linter/src/snapshots/no_empty_interface.snap index a4120f49c..24e6bd590 100644 --- a/crates/oxc_linter/src/snapshots/no_empty_interface.snap +++ b/crates/oxc_linter/src/snapshots/no_empty_interface.snap @@ -8,6 +8,11 @@ expression: no_empty_interface · ──────────────── ╰──── + × Expected `{` but found `EOF` + ╭─[no_empty_interface.tsx:1:25] + 1 │ interface Foo extends {} + ╰──── + ⚠ typescript-eslint(no-empty-interface): an interface declaring no members is equivalent to its supertype ╭─[no_empty_interface.tsx:6:4] 5 │