egoist / egoist/tsup

Types are not visually recognized in VSCode after build

Open
#1,278 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
274
PR merge metrics
No merged PRs in 30d

Description

After building my code with tsup, the types are not visually identified as such in VSCode. The type icon is not displayed correctly, causing confusion when working in the editor, although functionality is not affected.

The source code:
```typescript
export interface ButtonProps
extends React.ButtonHTMLAttributes,
VariantProps {
asChild?: boolean
}
```

The generated types:

```typescript
interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps {
asChild?: boolean;
}

export { type ButtonProps };
```

Causes this behavior:

![Image](https://github.com/user-attachments/assets/64de68e2-0d0b-4834-827a-ac7423971cd7)

And if i manually change the builded code to export the interface directly:

![Image](https://github.com/user-attachments/assets/7fb77acb-d8c6-4996-ab86-bd75203eee00)

I don't know if this is really a problem, but I'd like to know why it's happening :)

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are named. Reproduce the shown TypeScript interface build with tsup, then compare the generated declaration with VSCode's type-icon behavior. Determine whether the export form comes from tsup or TypeScript; done means identifying the responsible tool and confirming a fix or explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.