-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(48445): show errors on type-only import/export specifiers in Java…
…Script files
- Loading branch information
1 parent
1ed1a23
commit ad23f0b
Showing
9 changed files
with
73 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
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,9 @@ | ||
tests/cases/conformance/externalModules/typeOnly/a.js(2,10): error TS8006: 'type foo' declarations can only be used in TypeScript files. | ||
|
||
|
||
==== tests/cases/conformance/externalModules/typeOnly/a.js (1 errors) ==== | ||
const foo = 0; | ||
export { type foo }; | ||
~~~~~~~~ | ||
!!! error TS8006: 'type foo' declarations can only be used in TypeScript files. | ||
|
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,7 @@ | ||
=== tests/cases/conformance/externalModules/typeOnly/a.js === | ||
const foo = 0; | ||
>foo : Symbol(foo, Decl(a.js, 0, 5)) | ||
|
||
export { type foo }; | ||
>foo : Symbol(foo, Decl(a.js, 1, 8)) | ||
|
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,8 @@ | ||
=== tests/cases/conformance/externalModules/typeOnly/a.js === | ||
const foo = 0; | ||
>foo : 0 | ||
>0 : 0 | ||
|
||
export { type foo }; | ||
>foo : 0 | ||
|
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 @@ | ||
tests/cases/conformance/externalModules/typeOnly/a.js(1,10): error TS8006: 'type A' declarations can only be used in TypeScript files. | ||
|
||
|
||
==== tests/cases/conformance/externalModules/typeOnly/a.ts (0 errors) ==== | ||
export interface A {} | ||
|
||
==== tests/cases/conformance/externalModules/typeOnly/a.js (1 errors) ==== | ||
import { type A } from "./a"; | ||
~~~~~~ | ||
!!! error TS8006: 'type A' declarations can only be used in TypeScript files. | ||
|
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,8 @@ | ||
=== tests/cases/conformance/externalModules/typeOnly/a.ts === | ||
export interface A {} | ||
>A : Symbol(A, Decl(a.ts, 0, 0)) | ||
|
||
=== tests/cases/conformance/externalModules/typeOnly/a.js === | ||
import { type A } from "./a"; | ||
>A : Symbol(A, Decl(a.js, 0, 8)) | ||
|
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,7 @@ | ||
=== tests/cases/conformance/externalModules/typeOnly/a.ts === | ||
export interface A {} | ||
No type information for this code. | ||
No type information for this code.=== tests/cases/conformance/externalModules/typeOnly/a.js === | ||
import { type A } from "./a"; | ||
>A : any | ||
|
7 changes: 7 additions & 0 deletions
7
tests/cases/conformance/externalModules/typeOnly/exportSpecifiers_js.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,7 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @noEmit: true | ||
|
||
// @Filename: ./a.js | ||
const foo = 0; | ||
export { type foo }; |
9 changes: 9 additions & 0 deletions
9
tests/cases/conformance/externalModules/typeOnly/importSpecifiers_js.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,9 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @noEmit: true | ||
|
||
// @Filename: ./a.ts | ||
export interface A {} | ||
|
||
// @Filename: ./a.js | ||
import { type A } from "./a"; |