Test cases for different typescript syntax not supported errors during js files compilation
This commit is contained in:
parent
63de162d1e
commit
57e17d2663
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
declare var v;
|
||||
~~~~~~~
|
||||
!!! error TS8009: 'declare' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,1): error TS8017: 'decorators' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
@internal class C { }
|
||||
~~~~~~~~~
|
||||
!!! error TS8017: 'decorators' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
enum E { }
|
||||
~
|
||||
!!! error TS8015: 'enum declarations' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
export = b;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS8003: 'export=' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C implements D { }
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS8005: 'implements clauses' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
import a = b;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS8002: 'import ... =' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
interface I { }
|
||||
~
|
||||
!!! error TS8006: 'interface declarations' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
module M { }
|
||||
~
|
||||
!!! error TS8007: 'module declarations' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F(p?) { }
|
||||
~
|
||||
!!! error TS8009: '?' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,11): error TS8014: 'property declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C { v }
|
||||
~
|
||||
!!! error TS8014: 'property declarations' can only be used in a .ts file.
|
|
@ -0,0 +1,12 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C {
|
||||
public foo() {
|
||||
~~~~~~
|
||||
!!! error TS8009: 'public' can only be used in a .ts file.
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C { constructor(public x) { }}
|
||||
~~~~~~
|
||||
!!! error TS8012: 'parameter modifiers' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F(): number { }
|
||||
~~~~~~
|
||||
!!! error TS8010: 'types' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,1): error TS8008: 'type aliases' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
type a = b;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS8008: 'type aliases' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
Foo<number>();
|
||||
~~~~~~
|
||||
!!! error TS8011: 'type arguments' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,10): error TS8016: 'type assertion expressions' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
var v = <string>undefined;
|
||||
~~~~~~
|
||||
!!! error TS8016: 'type assertion expressions' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F(a: number) { }
|
||||
~~~~~~
|
||||
!!! error TS8010: 'types' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C<T> { }
|
||||
~
|
||||
!!! error TS8004: 'type parameter declarations' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F<T>() { }
|
||||
~
|
||||
!!! error TS8004: 'type parameter declarations' can only be used in a .ts file.
|
|
@ -0,0 +1,9 @@
|
|||
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
var v: () => number;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS8010: 'types' can only be used in a .ts file.
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
declare var v;
|
2
tests/cases/compiler/jsFileCompilationDecoratorSyntax.ts
Normal file
2
tests/cases/compiler/jsFileCompilationDecoratorSyntax.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
@internal class C { }
|
2
tests/cases/compiler/jsFileCompilationEnumSyntax.ts
Normal file
2
tests/cases/compiler/jsFileCompilationEnumSyntax.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
enum E { }
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
export = b;
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
class C implements D { }
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
import a = b;
|
2
tests/cases/compiler/jsFileCompilationInterfaceSyntax.ts
Normal file
2
tests/cases/compiler/jsFileCompilationInterfaceSyntax.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
interface I { }
|
2
tests/cases/compiler/jsFileCompilationModuleSyntax.ts
Normal file
2
tests/cases/compiler/jsFileCompilationModuleSyntax.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
module M { }
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
function F(p?) { }
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
class C { v }
|
|
@ -0,0 +1,5 @@
|
|||
// @filename: a.js
|
||||
class C {
|
||||
public foo() {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
class C { constructor(public x) { }}
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
function F(): number { }
|
2
tests/cases/compiler/jsFileCompilationTypeAliasSyntax.ts
Normal file
2
tests/cases/compiler/jsFileCompilationTypeAliasSyntax.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
type a = b;
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
Foo<number>();
|
2
tests/cases/compiler/jsFileCompilationTypeAssertions.ts
Normal file
2
tests/cases/compiler/jsFileCompilationTypeAssertions.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
var v = <string>undefined;
|
2
tests/cases/compiler/jsFileCompilationTypeOfParameter.ts
Normal file
2
tests/cases/compiler/jsFileCompilationTypeOfParameter.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
function F(a: number) { }
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
class C<T> { }
|
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
function F<T>() { }
|
2
tests/cases/compiler/jsFileCompilationTypeSyntaxOfVar.ts
Normal file
2
tests/cases/compiler/jsFileCompilationTypeSyntaxOfVar.ts
Normal file
|
@ -0,0 +1,2 @@
|
|||
// @filename: a.js
|
||||
var v: () => number;
|
Loading…
Reference in a new issue