-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
Bug Report
π Search Terms
declaration import rewritedeclaration import change
π Version & Regression Information
- Probably has always been like that (verified it in 4.9, 4.8, 4.7)
β― Playground Link
Sadly not possible as it's about importing of "nested" dependencies.
So I created a reproduction repository
- Clone https://github.com/daKmoR/tsbug-declaration-output
- Run
npm install - Run
npm run types - Inspect the output in
dist-types
π» Code
When creating types from a ts source file it keeps the import pathes as is. (which is expected)
π Source: src/ElementA.ts
import { LitElement } from "lit";
export class ElementA extends LitElement {}π Output: dist-types/src/ElementA.d.ts
import { LitElement } from "lit";
export declare class ElementA extends LitElement {}When creating types from "the exact same file" but as a js it changes the import pathes by "resolving" them.
π Source: src/ElementB.js
import { LitElement } from "lit";
export class ElementB extends LitElement {}π Actual behavior
π Output: dist-types/src/ElementB.d.ts
export class ElementB extends LitElement {}
import { LitElement } from "lit-element/lit-element.js";π Expected behavior
export class ElementB extends LitElement {}
import { LitElement } from "lit";Consequences
Because of the miss match between the "location" of LitElement TS believes those are different LitElement types.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.