mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Report error on export assignment with es6 and above target
Conflicts: src/compiler/checker.ts tests/baselines/reference/es6ImportDefaultBinding.errors.txt tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport1.errors.txt tests/baselines/reference/es6ImportDefaultBindingMergeErrors.errors.txt tests/baselines/reference/es6ImportEqualsDeclaration.errors.txt tests/cases/compiler/es6ImportNameSpaceImportMergeErrors.ts tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports.ts tests/cases/compiler/es6ImportNamedImportInExportAssignment.ts tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment.ts tests/cases/compiler/es6ImportNamedImportNoNamedExports.ts
This commit is contained in:
12
tests/baselines/reference/es6ExportAssignment.errors.txt
Normal file
12
tests/baselines/reference/es6ExportAssignment.errors.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
tests/cases/compiler/es6ExportAssignment.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
|
||||
tests/cases/compiler/es6ExportAssignment.ts(3,1): error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ExportAssignment.ts (2 errors) ====
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
8
tests/baselines/reference/es6ExportAssignment.js
Normal file
8
tests/baselines/reference/es6ExportAssignment.js
Normal file
@@ -0,0 +1,8 @@
|
||||
//// [es6ExportAssignment.ts]
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
|
||||
//// [es6ExportAssignment.js]
|
||||
var a = 10;
|
||||
module.exports = a;
|
||||
@@ -1,15 +1,18 @@
|
||||
tests/cases/compiler/client.ts(1,1): error TS1200: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead.
|
||||
tests/cases/compiler/server.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
|
||||
tests/cases/compiler/server.ts(3,1): error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
|
||||
|
||||
==== tests/cases/compiler/client.ts (1 errors) ====
|
||||
import a = require("server");
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1200: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead.
|
||||
==== tests/cases/compiler/server.ts (1 errors) ====
|
||||
==== tests/cases/compiler/server.ts (2 errors) ====
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
|
||||
|
||||
4
tests/cases/compiler/es6ExportAssignment.ts
Normal file
4
tests/cases/compiler/es6ExportAssignment.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// @target: es6
|
||||
|
||||
var a = 10;
|
||||
export = a;
|
||||
Reference in New Issue
Block a user