Skip to content

Commit 595a8d2

Browse files
committed
Merge pull request microsoft#4064 from RyanCavanaugh/tsconfigFilesError
Error if 'files' property is not an array
2 parents 0a9fb1a + 3281612 commit 595a8d2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,13 @@ namespace ts {
422422
if (json["files"] instanceof Array) {
423423
fileNames = map(<string[]>json["files"], s => combinePaths(basePath, s));
424424
}
425+
else {
426+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, 'files', 'Array'));
427+
}
425428
}
426429
else {
427430
let exclude = json["exclude"] instanceof Array ? map(<string[]>json["exclude"], normalizeSlashes) : undefined;
428-
let sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude));
431+
let sysFiles = host.readDirectory(basePath, ".ts", exclude).concat(host.readDirectory(basePath, ".tsx", exclude));
429432
for (let i = 0; i < sysFiles.length; i++) {
430433
let name = sysFiles[i];
431434
if (fileExtensionIs(name, ".d.ts")) {

0 commit comments

Comments
 (0)