Skip to content

Commit df6aa85

Browse files
author
Arnavion
committed
Don't allow -noEmit with -out or -outDir
1 parent cd6eb18 commit df6aa85

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ module ts {
378378
Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" },
379379
Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: DiagnosticCategory.Error, key: "Option mapRoot cannot be specified without specifying sourcemap option." },
380380
Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: DiagnosticCategory.Error, key: "Option sourceRoot cannot be specified without specifying sourcemap option." },
381+
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: DiagnosticCategory.Error, key: "Option noEmit cannot be specified with option out or outDir." },
381382
Concatenate_and_emit_output_to_single_file: { code: 6001, category: DiagnosticCategory.Message, key: "Concatenate and emit output to single file." },
382383
Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." },
383384
Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." },

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,10 @@
15111511
"category": "Error",
15121512
"code": 5039
15131513
},
1514+
"Option noEmit cannot be specified with option out or outDir.": {
1515+
"category": "Error",
1516+
"code": 5040
1517+
},
15141518
"Concatenate and emit output to single file.": {
15151519
"category": "Message",
15161520
"code": 6001

src/compiler/parser.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5539,6 +5539,12 @@ module ts {
55395539
commonSourceDirectory += directorySeparator;
55405540
}
55415541
}
5542+
5543+
if (options.noEmit) {
5544+
if (options.out || options.outDir) {
5545+
errors.push(createCompilerDiagnostic(Diagnostics.Option_noEmit_cannot_be_specified_with_option_out_or_outDir));
5546+
}
5547+
}
55425548
}
55435549
}
55445550
}

0 commit comments

Comments
 (0)