Skip to content

Commit ea984d7

Browse files
committed
Centralize diagnostic reporting for empty files diagnostic
1 parent 959dbbb commit ea984d7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ namespace ts {
18461846
const hasReferences = hasProperty(raw, "references") && !isNullOrUndefined(raw.references);
18471847
const hasZeroOrNoReferences = !hasReferences || raw.references.length === 0;
18481848
if (filesSpecs.length === 0 && hasZeroOrNoReferences) {
1849-
createCompilerDiagnosticOnlyIfJson(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json");
1849+
errors.push(createCompilerDiagnostic(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json"));
18501850
}
18511851
}
18521852
else {
@@ -2078,12 +2078,6 @@ namespace ts {
20782078
}
20792079
};
20802080
const json = convertToObjectWorker(sourceFile, errors, /*returnValue*/ true, getTsconfigRootOptionsMap(), optionsIterator);
2081-
const hasZeroFiles = json && json.files && json.files.length === 0;
2082-
const hasZeroOrNoReferences = !(json && json.references) || json.references.length === 0;
2083-
2084-
if (hasZeroFiles && hasZeroOrNoReferences) {
2085-
errors.push(createCompilerDiagnostic(Diagnostics.The_files_list_in_config_file_0_is_empty, sourceFile.fileName));
2086-
}
20872081

20882082
if (!typeAcquisition) {
20892083
if (typingOptionstypeAcquisition) {

0 commit comments

Comments
 (0)