Skip to content

Commit 9d008fe

Browse files
committed
Added module: none as an option
(cherry picked from commit 195e69c)
1 parent 6a8ccd0 commit 9d008fe

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
"category": "Error",
448448
"code": 1147
449449
},
450-
"Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.": {
450+
"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.": {
451451
"category": "Error",
452452
"code": 1148
453453
},
@@ -2320,7 +2320,7 @@
23202320
"category": "Error",
23212321
"code": 6045
23222322
},
2323-
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es2015'.": {
2323+
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'none'.": {
23242324
"category": "Error",
23252325
"code": 6046
23262326
},

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ namespace ts {
16651665
else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && options.module === ModuleKind.None) {
16661666
// We cannot use createDiagnosticFromNode because nodes do not have parents yet
16671667
const span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
1668-
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));
1668+
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));
16691669
}
16701670

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

0 commit comments

Comments
 (0)