Skip to content

Commit 6954a4a

Browse files
authored
test(eslint-plugin): [no-unused-vars] add export import namespace testcase (typescript-eslint#8552)
1 parent 156c528 commit 6954a4a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,14 @@ export = {} as Foo;
11131113
declare module 'foo' {
11141114
type Foo = 1;
11151115
export = Foo;
1116+
}
1117+
`,
1118+
`
1119+
namespace Foo {
1120+
export const foo = 1;
1121+
}
1122+
export namespace Bar {
1123+
export import TheFoo = Foo;
11161124
}
11171125
`,
11181126
],
@@ -1920,5 +1928,27 @@ export = Foo;
19201928
},
19211929
],
19221930
},
1931+
{
1932+
code: `
1933+
namespace Foo {
1934+
export const foo = 1;
1935+
}
1936+
export namespace Bar {
1937+
import TheFoo = Foo;
1938+
}
1939+
`,
1940+
errors: [
1941+
{
1942+
messageId: 'unusedVar',
1943+
line: 6,
1944+
column: 10,
1945+
data: {
1946+
varName: 'TheFoo',
1947+
action: 'defined',
1948+
additional: '',
1949+
},
1950+
},
1951+
],
1952+
},
19231953
],
19241954
});

0 commit comments

Comments
 (0)