egoist / egoist/tsup

circular reference in namespace export due to invalid import name

Open
#804 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.