Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ts exported vars are shadowed by
declare
(#14946)
* fix * review
- Loading branch information
1 parent
c602be9
commit bedfc72
Showing
3 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/babel-plugin-transform-typescript/test/fixtures/exports/declare-shadowed/input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
declare class Signal<T = any> { | ||
value: T | ||
} | ||
|
||
function Signal(this: Signal, value?: unknown) { | ||
this.value = value | ||
} | ||
|
||
export { Signal }; | ||
|
||
|
||
function Signal2(this: Signal2, value?: unknown) { | ||
this.value = value | ||
} | ||
declare class Signal2<T = any> { | ||
value: T | ||
} | ||
|
||
export { Signal2 }; |
11 changes: 11 additions & 0 deletions
11
packages/babel-plugin-transform-typescript/test/fixtures/exports/declare-shadowed/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function Signal(value) { | ||
this.value = value; | ||
} | ||
|
||
export { Signal }; | ||
|
||
function Signal2(value) { | ||
this.value = value; | ||
} | ||
|
||
export { Signal2 }; |