Skip to content

There is an issue with the conversion of TypeScript Classes, which does not meet expectations and results in unexpected code running outcomes. #399

@MyDataHouse

Description

@MyDataHouse

Reproduction link or steps

Image

The results of class conversion by tsdown differ from those converted by TypeScript, causing problems when I migrate my project to tsdown.

The main issue is that tsdown retains uninitialized properties during conversion, whereas TypeScript does not. This makes it impossible to read properties with the same name on the prototype via the prototype chain. I hope that the results of tsdown's TypeScript conversion can be consistent with those of TypeScript's conversion.

This is the result of conversion by tsdown.

Image

This is the result of conversion by TypeScript.

Image

What is expected?

Consistently align with TypeScript's transpilation results by automatically removing uninitialized properties in classes.

What is actually happening?

It is inconsistent with the TypeScript transpilation results.

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions