From ea984d7b64fc7b57d643ffc2792eac01baccddc2 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 5 Sep 2018 23:18:39 -0400 Subject: [PATCH] Centralize diagnostic reporting for empty files diagnostic --- src/compiler/commandLineParser.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 5d87525073f..a2dac4e7d33 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1846,7 +1846,7 @@ namespace ts { const hasReferences = hasProperty(raw, "references") && !isNullOrUndefined(raw.references); const hasZeroOrNoReferences = !hasReferences || raw.references.length === 0; if (filesSpecs.length === 0 && hasZeroOrNoReferences) { - createCompilerDiagnosticOnlyIfJson(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json"); + errors.push(createCompilerDiagnostic(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json")); } } else { @@ -2078,12 +2078,6 @@ namespace ts { } }; const json = convertToObjectWorker(sourceFile, errors, /*returnValue*/ true, getTsconfigRootOptionsMap(), optionsIterator); - const hasZeroFiles = json && json.files && json.files.length === 0; - const hasZeroOrNoReferences = !(json && json.references) || json.references.length === 0; - - if (hasZeroFiles && hasZeroOrNoReferences) { - errors.push(createCompilerDiagnostic(Diagnostics.The_files_list_in_config_file_0_is_empty, sourceFile.fileName)); - } if (!typeAcquisition) { if (typingOptionstypeAcquisition) {