mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Fix export = error message to not have redundant language (#50308)
This commit is contained in:
@@ -2819,7 +2819,7 @@ namespace ts {
|
||||
if (exportAssignment) {
|
||||
addRelatedInfo(err, createDiagnosticForNode(
|
||||
exportAssignment,
|
||||
Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,
|
||||
Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,
|
||||
compilerOptionName
|
||||
));
|
||||
}
|
||||
|
||||
@@ -2677,7 +2677,7 @@
|
||||
"category": "Error",
|
||||
"code": 2593
|
||||
},
|
||||
"This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.": {
|
||||
"This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.": {
|
||||
"category": "Error",
|
||||
"code": 2594
|
||||
},
|
||||
|
||||
@@ -11,6 +11,6 @@ tests/cases/compiler/a.ts(1,8): error TS1259: Module '"tests/cases/compiler/b"'
|
||||
import Foo from "./b";
|
||||
~~~
|
||||
!!! error TS1259: Module '"tests/cases/compiler/b"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/b.d.ts:4:1: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/b.d.ts:4:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
export var x = new Foo();
|
||||
|
||||
@@ -77,43 +77,43 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses
|
||||
import x1 from "interface";
|
||||
~~
|
||||
!!! error TS1259: Module '"interface"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:6:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:6:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x2 from "variable";
|
||||
~~
|
||||
!!! error TS1259: Module '"variable"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:14:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:14:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x3 from "interface-variable";
|
||||
~~
|
||||
!!! error TS1259: Module '"interface-variable"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:26:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:26:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x4 from "module";
|
||||
~~
|
||||
!!! error TS1259: Module '"module"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:34:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:34:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x5 from "interface-module";
|
||||
~~
|
||||
!!! error TS1259: Module '"interface-module"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:46:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:46:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x6 from "variable-module";
|
||||
~~
|
||||
!!! error TS1259: Module '"variable-module"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:60:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:60:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x7 from "function";
|
||||
~~
|
||||
!!! error TS1259: Module '"function"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:65:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:65:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x8 from "function-module";
|
||||
~~
|
||||
!!! error TS1259: Module '"function-module"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:74:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:74:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x9 from "class";
|
||||
~~
|
||||
!!! error TS1259: Module '"class"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:82:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:82:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
import x0 from "class-module";
|
||||
~~
|
||||
!!! error TS1259: Module '"class-module"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:94:5: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/modules.d.ts:94:5: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
|
||||
// namespace import
|
||||
import * as y1 from "interface";
|
||||
|
||||
@@ -9,4 +9,4 @@ tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts(1,8): error TS1259: Modul
|
||||
import defaultBinding from "./es6ImportDefaultBindingInEs5_0";
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1259: Module '"tests/cases/compiler/es6ImportDefaultBindingInEs5_0"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 tests/cases/compiler/es6ImportDefaultBindingInEs5_0.ts:2:1: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 tests/cases/compiler/es6ImportDefaultBindingInEs5_0.ts:2:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
@@ -12,4 +12,4 @@
|
||||
import bar from './bar';
|
||||
~~~
|
||||
!!! error TS1259: Module '"/bar"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
|
||||
!!! related TS2594 /bar.ts:1:1: This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
|
||||
!!! related TS2594 /bar.ts:1:1: This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.
|
||||
@@ -12,5 +12,5 @@
|
||||
import a from "./a";
|
||||
~
|
||||
!!! error TS1259: Module '"/a"' can only be default-imported using the 'esModuleInterop' flag
|
||||
!!! related TS2594 /a.js:5:1: This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
!!! related TS2594 /a.js:5:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
|
||||
@@ -35,7 +35,7 @@ Output::
|
||||
[96msettings.json[0m:[93m1[0m:[93m1[0m
|
||||
[7m1[0m {"content":"Print this"}
|
||||
[7m [0m [96m~[0m
|
||||
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
|
||||
|
||||
[[90m12:00:26 AM[0m] Found 1 error. Watching for file changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user