Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove imported types from export (#13800)
* fix: remove imported types from export * add onlyRemoveTypeImports testcase
- Loading branch information
Showing
6 changed files
with
34 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
5 changes: 5 additions & 0 deletions
5
...ansform-typescript/test/fixtures/exports/imported-types-only-remove-type-imports/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,5 @@ | ||
import type A from "A"; | ||
import type { B } from "B"; | ||
import C from "C"; | ||
|
||
export { A, B, C } // <-- A and B will be removed |
10 changes: 10 additions & 0 deletions
10
...orm-typescript/test/fixtures/exports/imported-types-only-remove-type-imports/options.json
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,10 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"transform-typescript", | ||
{ | ||
"onlyRemoveTypeImports": true | ||
} | ||
] | ||
] | ||
} |
2 changes: 2 additions & 0 deletions
2
...sform-typescript/test/fixtures/exports/imported-types-only-remove-type-imports/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,2 @@ | ||
import C from "C"; | ||
export { C }; // <-- A and B will be removed |
5 changes: 5 additions & 0 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/exports/imported-types/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,5 @@ | ||
import type A from "A"; | ||
import type { B } from "B"; | ||
import C from "C"; | ||
|
||
export { A, B, C } // <-- A and B will be removed |
2 changes: 2 additions & 0 deletions
2
packages/babel-plugin-transform-typescript/test/fixtures/exports/imported-types/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,2 @@ | ||
import C from "C"; | ||
export { C }; // <-- A and B will be removed |