-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFix AvailableA PR has been opened for this issueA PR has been opened for this issueRecent RegressionThis is a new regression just found in the last major/minor version of TypeScript.This is a new regression just found in the last major/minor version of TypeScript.
Milestone
Description
π Search Terms
remove import compilation decorator
π Version & Regression Information
- This changed between versions 5.4 and 5.5
β― Playground Link
https://github.com/RomainLanz/typescript-output-issue
npm install
npm run build
π» Code
import { DateTime } from "luxon";
import { column } from "@adonisjs/lucid/orm";
class User {
@column.dateTime()
declare createdAt: DateTime;
}
π Actual behavior
When compiled the DateTime
import is being removed (because it is only used as a type in our file), but the compilation of @column.dateTime()
will use the import.
// ...
import { column } from "@adonisjs/lucid/orm";
class User {
}
__decorate([
column.dateTime(),
__metadata("design:type", typeof (_a = typeof DateTime !== "undefined" && DateTime) === "function" ? _a : Object)
], User.prototype, "createdAt", void 0);
π Expected behavior
The import should be kept like in TypeScript 5.4.
import { DateTime } from "luxon";
import { column } from "@adonisjs/lucid/orm";
class User {
}
__decorate([
column.dateTime(),
__metadata("design:type", typeof (_a = typeof DateTime !== "undefined" && DateTime) === "function" ? _a : Object)
], User.prototype, "createdAt", void 0);
Additional information about the issue
No response
mattstrayer, Max10240, CodingDive, luffynando, SimoneStefani and 4 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesFix AvailableA PR has been opened for this issueA PR has been opened for this issueRecent RegressionThis is a new regression just found in the last major/minor version of TypeScript.This is a new regression just found in the last major/minor version of TypeScript.