egoist / egoist/tsup

[bug] generates a dts error when typeof this is encountered

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

Description

my code
```ts
export default class {
name: 'foo' | 'bar'

logName(name:typeof this.name) {
console.log(name)
}
}
```

generate dts
```d.ts
declare class export_default{
name: 'foo' | 'bar';
logName(name: typeof this$1.name): void;
}

export { export_default as default };
```

my versions
```json
"devDependencies": {
"tsup": "^7.2.0"
},
"dependencies": {
"typescript": "^5.2.2"
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with the provided TypeScript class and the listed tsup 7.2.0 and TypeScript 5.2.2 versions, then trace the declaration-generation entry point that produces the shown output. Done means the generated declaration no longer contains an invalid typeof this$1.name reference; no source file or test is named in the report.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.