From 5162edbdc2f6774cbdd73cc388eaea17024999fb Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Mon, 26 Oct 2015 10:43:55 -0700 Subject: [PATCH] allow other files except .d.ts as external library packages --- src/compiler/diagnosticMessages.json | 4 ---- src/compiler/program.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b2c1e6f0d5e..4f44127ca75 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 0f427e9c5f1..feddd793e02 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));