Skip to content

Commit

Permalink
test: failing case for shadowed namespace in .d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
llllvvuu committed Aug 19, 2023
1 parent cd95728 commit e554378
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/files/typescript-declare-nested-shadowed.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
declare namespace foo {
interface SomeInterface {
a: string;
}
}

declare namespace foo.bar {
interface SomeOtherInterface {
b: string;
}

function MyFunction();
}

declare const foo: foo.SomeInterface;
export = foo;
12 changes: 12 additions & 0 deletions tests/src/rules/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ const valid = [
},
}),

test({
code: `
import * as foo from "./typescript-declare-nested-shadowed"
console.log(foo.a)
`,
parser,
settings: {
'import/parsers': { [parser]: ['.ts'] },
'import/resolver': { 'eslint-import-resolver-typescript': true },
},
}),

test({
code: `import { foobar } from "./typescript-declare-interface"`,
parser,
Expand Down

0 comments on commit e554378

Please sign in to comment.