-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report every instance of TS1208 (#50101)
* Report every instance of TS1208 * Test case for multiple cases of TS1208 * Add test case for isolatedModules with moduleDetection forced
- Loading branch information
Showing
10 changed files
with
99 additions
and
5 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
6 changes: 6 additions & 0 deletions
6
tests/baselines/reference/isolatedModulesExternalModuleForced.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,6 @@ | ||
//// [file1.ts] | ||
var x; | ||
|
||
//// [file1.js] | ||
var x; | ||
export {}; |
4 changes: 4 additions & 0 deletions
4
tests/baselines/reference/isolatedModulesExternalModuleForced.symbols
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,4 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
var x; | ||
>x : Symbol(x, Decl(file1.ts, 0, 3)) | ||
|
4 changes: 4 additions & 0 deletions
4
tests/baselines/reference/isolatedModulesExternalModuleForced.types
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,4 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
var x; | ||
>x : any | ||
|
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/isolatedModulesNoExternalModuleMultiple.errors.txt
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,20 @@ | ||
tests/cases/compiler/file1.ts(1,1): error TS1208: 'file1.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. | ||
tests/cases/compiler/file2.ts(1,1): error TS1208: 'file2.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. | ||
tests/cases/compiler/file3.ts(1,1): error TS1208: 'file3.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. | ||
|
||
|
||
==== tests/cases/compiler/file1.ts (1 errors) ==== | ||
var x; | ||
~~~ | ||
!!! error TS1208: 'file1.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. | ||
|
||
==== tests/cases/compiler/file2.ts (1 errors) ==== | ||
var y; | ||
~~~ | ||
!!! error TS1208: 'file2.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. | ||
|
||
==== tests/cases/compiler/file3.ts (1 errors) ==== | ||
var z; | ||
~~~ | ||
!!! error TS1208: 'file3.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module. | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/isolatedModulesNoExternalModuleMultiple.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,18 @@ | ||
//// [tests/cases/compiler/isolatedModulesNoExternalModuleMultiple.ts] //// | ||
|
||
//// [file1.ts] | ||
var x; | ||
|
||
//// [file2.ts] | ||
var y; | ||
|
||
//// [file3.ts] | ||
var z; | ||
|
||
|
||
//// [file1.js] | ||
var x; | ||
//// [file2.js] | ||
var y; | ||
//// [file3.js] | ||
var z; |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/isolatedModulesNoExternalModuleMultiple.symbols
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,12 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
var x; | ||
>x : Symbol(x, Decl(file1.ts, 0, 3)) | ||
|
||
=== tests/cases/compiler/file2.ts === | ||
var y; | ||
>y : Symbol(y, Decl(file2.ts, 0, 3)) | ||
|
||
=== tests/cases/compiler/file3.ts === | ||
var z; | ||
>z : Symbol(z, Decl(file3.ts, 0, 3)) | ||
|
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/isolatedModulesNoExternalModuleMultiple.types
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,12 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
var x; | ||
>x : any | ||
|
||
=== tests/cases/compiler/file2.ts === | ||
var y; | ||
>y : any | ||
|
||
=== tests/cases/compiler/file3.ts === | ||
var z; | ||
>z : any | ||
|
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 @@ | ||
// @isolatedModules: true | ||
// @target: es6 | ||
// @moduleDetection: force | ||
|
||
// @filename: file1.ts | ||
var x; |
11 changes: 11 additions & 0 deletions
11
tests/cases/compiler/isolatedModulesNoExternalModuleMultiple.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,11 @@ | ||
// @isolatedModules: true | ||
// @target: es6 | ||
|
||
// @filename: file1.ts | ||
var x; | ||
|
||
// @filename: file2.ts | ||
var y; | ||
|
||
// @filename: file3.ts | ||
var z; |