Skip to content

Commit 195e69c

Browse files
committed
Added module: none as an option
1 parent 4a67dc5 commit 195e69c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ namespace ts {
7878
name: "module",
7979
shortName: "m",
8080
type: {
81+
"none": ModuleKind.None,
8182
"commonjs": ModuleKind.CommonJS,
8283
"amd": ModuleKind.AMD,
8384
"system": ModuleKind.System,
@@ -87,7 +88,7 @@ namespace ts {
8788
},
8889
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
8990
paramType: Diagnostics.KIND,
90-
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_or_es2015
91+
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_es2015_or_none
9192
},
9293
{
9394
name: "newLine",

src/compiler/diagnosticMessages.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
"category": "Error",
440440
"code": 1147
441441
},
442-
"Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.": {
442+
"Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file.": {
443443
"category": "Error",
444444
"code": 1148
445445
},
@@ -2171,7 +2171,7 @@
21712171
"category": "Error",
21722172
"code": 5059
21732173
},
2174-
2174+
21752175

21762176
"Concatenate and emit output to single file.": {
21772177
"category": "Message",
@@ -2305,7 +2305,7 @@
23052305
"category": "Error",
23062306
"code": 6045
23072307
},
2308-
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es2015'.": {
2308+
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'none'.": {
23092309
"category": "Error",
23102310
"code": 6046
23112311
},

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ namespace ts {
13031303
else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && options.module === ModuleKind.None) {
13041304
// We cannot use createDiagnosticFromNode because nodes do not have parents yet
13051305
const span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
1306-
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
1306+
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
13071307
}
13081308

13091309
// Cannot specify module gen target of es6 when below es6

0 commit comments

Comments
 (0)