Skip to content

Commit 60d8cf3

Browse files
committed
Merge pull request #5405 from Microsoft/allowAllFilesAsPackages
allow other files except .d.ts as external library packages
2 parents a1dcc42 + 751a8ea commit 60d8cf3

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,10 +1712,6 @@
17121712
"category": "Error",
17131713
"code": 2654
17141714
},
1715-
"Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition.": {
1716-
"category": "Error",
1717-
"code": 2655
1718-
},
17191715
"Exported external package typings file '{0}' is not a module. Please contact the package author to update the package definition.": {
17201716
"category": "Error",
17211717
"code": 2656

src/compiler/program.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,10 +863,6 @@ namespace ts {
863863
let start = getTokenPosOfNode(file.imports[i], file);
864864
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));
865865
}
866-
else if (!fileExtensionIs(importedFile.fileName, ".d.ts")) {
867-
let start = getTokenPosOfNode(file.imports[i], file);
868-
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));
869-
}
870866
else if (importedFile.referencedFiles.length) {
871867
let firstRef = importedFile.referencedFiles[0];
872868
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));

0 commit comments

Comments
 (0)