diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 188cf23f76c9c..139e078e2abe3 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1712,10 +1712,6 @@ "category": "Error", "code": 2654 }, - "Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition.": { - "category": "Error", - "code": 2655 - }, "Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition.": { "category": "Error", "code": 2656 diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d76e7585d1541..d39a4c7912f8c 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -863,10 +863,6 @@ namespace ts { let start = getTokenPosOfNode(file.imports[i], file); fileProcessingDiagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName)); } - else if (!fileExtensionIs(importedFile.fileName, ".d.ts")) { - let start = getTokenPosOfNode(file.imports[i], file); - fileProcessingDiagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Exported_external_package_typings_can_only_be_in_d_ts_files_Please_contact_the_package_author_to_update_the_package_definition)); - } else if (importedFile.referencedFiles.length) { let firstRef = importedFile.referencedFiles[0]; fileProcessingDiagnostics.add(createFileDiagnostic(importedFile, firstRef.pos, firstRef.end - firstRef.pos, Diagnostics.Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition));