Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw a better error when transforming imported bindings in types
- Loading branch information
1 parent
d87a3d9
commit 95c0689
Showing
9 changed files
with
69 additions
and
0 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
...in-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-deep/input.js
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 A from "x"; | ||
|
||
export function fn(x: A.b[2]) { | ||
return A.method(x); | ||
} |
6 changes: 6 additions & 0 deletions
6
...ransform-modules-commonjs/test/fixtures/integration/missing-flow-plugin-deep/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,6 @@ | ||
{ | ||
"externalHelpers": true, | ||
"sourceType": "module", | ||
"plugins": ["transform-modules-commonjs", "syntax-flow"], | ||
"throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." | ||
} |
5 changes: 5 additions & 0 deletions
5
...-plugin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin/input.js
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 A from "x"; | ||
|
||
export function fn(x: A) { | ||
return A.method(x); | ||
} |
6 changes: 6 additions & 0 deletions
6
...gin-transform-modules-commonjs/test/fixtures/integration/missing-flow-plugin/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,6 @@ | ||
{ | ||
"externalHelpers": true, | ||
"sourceType": "module", | ||
"plugins": ["transform-modules-commonjs", "syntax-flow"], | ||
"throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." | ||
} |
5 changes: 5 additions & 0 deletions
5
...ugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-deep/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 A from "x"; | ||
|
||
export function fn(x: A.b[2]) { | ||
return A.method(x); | ||
} |
6 changes: 6 additions & 0 deletions
6
...-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin-deep/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,6 @@ | ||
{ | ||
"externalHelpers": true, | ||
"sourceType": "module", | ||
"plugins": ["transform-modules-commonjs", "syntax-typescript"], | ||
"throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." | ||
} |
5 changes: 5 additions & 0 deletions
5
...el-plugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin/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 A from "x"; | ||
|
||
export function fn(x: A) { | ||
return A.method(x); | ||
} |
6 changes: 6 additions & 0 deletions
6
...lugin-transform-modules-commonjs/test/fixtures/integration/missing-ts-plugin/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,6 @@ | ||
{ | ||
"externalHelpers": true, | ||
"sourceType": "module", | ||
"plugins": ["transform-modules-commonjs", "syntax-typescript"], | ||
"throws": "Cannot transform the imported A binding since it's used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow." | ||
} |