circular reference in namespace export due to invalid import name
Open
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
A code like this:
```ts
import { Foo as Foo1 } from "./foo"
export namespace bar {
export type Foo = Foo1
}
```
generates invalid d.ts:
```ts
type Foo = string;
declare namespace bar {
type Foo = Foo; // Type alias 'Foo' circularly references itself. ts(2456)
}
export { bar };
```
Reproduction: https://stackblitz.com/edit/node-497knk
Run `tsup bar.ts --dts` and examine `dist/bar.d.ts`.
Contributor guide
Assessment
This issue has not been assessed yet.