Respond to code review comments
This commit is contained in:
parent
08fed17053
commit
d73dd06e4b
|
@ -447,7 +447,7 @@
|
|||
"category": "Error",
|
||||
"code": 1147
|
||||
},
|
||||
"Cannot use 'import', 'export' or module augmentation when compiling with '--module' is 'none'.": {
|
||||
"Cannot use imports, exports or module augmentations when '--module' is 'none'.": {
|
||||
"category": "Error",
|
||||
"code": 1148
|
||||
},
|
||||
|
@ -2752,7 +2752,7 @@
|
|||
"category": "Message",
|
||||
"code": 6130
|
||||
},
|
||||
"Cannot compile modules using option '{0}' unless the '--module' flag is provided with a valid module type.": {
|
||||
"Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'.": {
|
||||
"category": "Error",
|
||||
"code": 6131
|
||||
},
|
||||
|
|
|
@ -2080,7 +2080,7 @@ namespace ts {
|
|||
else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && options.module === ModuleKind.None) {
|
||||
// We cannot use createDiagnosticFromNode because nodes do not have parents yet
|
||||
const span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_import_export_or_module_augmentation_when_compiling_with_module_is_none));
|
||||
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
||||
}
|
||||
|
||||
// Cannot specify module gen target of es6 when below es6
|
||||
|
@ -2095,7 +2095,7 @@ namespace ts {
|
|||
}
|
||||
else if (options.module === undefined && firstExternalModuleSourceFile) {
|
||||
const span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_provided_with_a_valid_module_type, options.out ? "out" : "outFile"));
|
||||
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error TS5053: Option 'out' cannot be specified with option 'isolatedModules'.
|
||||
tests/cases/compiler/file1.ts(2,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is provided with a valid module type.
|
||||
tests/cases/compiler/file1.ts(2,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@ tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when
|
|||
|
||||
export var x;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is provided with a valid module type.
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
==== tests/cases/compiler/file2.ts (1 errors) ====
|
||||
var y;
|
||||
~~~
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
tests/cases/compiler/a.ts(1,14): error TS1148: Cannot use 'import', 'export' or module augmentation when compiling with '--module' is 'none'.
|
||||
tests/cases/compiler/a.ts(1,14): error TS1148: Cannot use imports, exports or module augmentations when '--module' is 'none'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.ts (1 errors) ====
|
||||
export class Foo {
|
||||
~~~
|
||||
!!! error TS1148: Cannot use 'import', 'export' or module augmentation when compiling with '--module' is 'none'.
|
||||
!!! error TS1148: Cannot use imports, exports or module augmentations when '--module' is 'none'.
|
||||
foo: string;
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
tests/cases/compiler/a.ts(2,14): error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is provided with a valid module type.
|
||||
tests/cases/compiler/a.ts(2,14): error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.ts (1 errors) ====
|
||||
|
||||
export class A { } // module
|
||||
~
|
||||
!!! error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is provided with a valid module type.
|
||||
!!! error TS6131: Cannot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
==== tests/cases/compiler/b.ts (0 errors) ====
|
||||
var x = 0; // global
|
|
@ -1,4 +1,4 @@
|
|||
/mod1.ts(2,17): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is provided with a valid module type.
|
||||
/mod1.ts(2,17): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
|
||||
==== /mod2.ts (0 errors) ====
|
||||
|
@ -14,5 +14,5 @@
|
|||
|
||||
export function foo(): Lib { return {x: 1} }
|
||||
~~~
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is provided with a valid module type.
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is provided with a valid module type.
|
||||
/main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
|
||||
==== /mod2.ts (0 errors) ====
|
||||
|
@ -16,7 +16,7 @@
|
|||
==== /main.ts (1 errors) ====
|
||||
export class Cls {
|
||||
~~~
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is provided with a valid module type.
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
x
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue