Skip to content

Commit cc1ca22

Browse files
committed
test: failing case for shadowed namespace in .d.ts
1 parent cd95728 commit cc1ca22

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
declare namespace foo {
2+
interface SomeInterface {
3+
a: string;
4+
}
5+
}
6+
7+
declare namespace foo.bar {
8+
interface SomeOtherInterface {
9+
b: string;
10+
}
11+
12+
function MyFunction();
13+
}
14+
15+
declare const foo: foo.SomeInterface;
16+
export = foo;

tests/src/rules/namespace.js

+12
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ const valid = [
156156
},
157157
}),
158158

159+
test({
160+
code: `
161+
import * as foo from "./typescript-declare-nested-shadowed"
162+
console.log(foo.c)
163+
`,
164+
parser,
165+
settings: {
166+
'import/parsers': { [parser]: ['.ts'] },
167+
'import/resolver': { 'eslint-import-resolver-typescript': true },
168+
},
169+
}),
170+
159171
test({
160172
code: `import { foobar } from "./typescript-declare-interface"`,
161173
parser,

0 commit comments

Comments
 (0)