Merge pull request #26121 from mattmccutchen/issue-23999

"Could not find a declaration file for module" error needs to use the unmangled package name where appropriate.
This commit is contained in:
Ryan Cavanaugh
2018-08-01 20:55:31 -07:00
committed by GitHub
8 changed files with 107 additions and 7 deletions
+3 -2
View File
@@ -2244,8 +2244,9 @@ namespace ts {
? chainDiagnosticMessages(
/*details*/ undefined,
typesPackageExists(packageId.name)
? Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_0
: Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
? Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1
: Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
packageId.name,
getMangledNameForScopedPackage(packageId.name))
: undefined;
errorOrSuggestion(isError, errorNode, chainDiagnosticMessages(
+2 -2
View File
@@ -3901,7 +3901,7 @@
"category": "Error",
"code": 7034
},
"Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`": {
"Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`": {
"category": "Error",
"code": 7035
},
@@ -3921,7 +3921,7 @@
"category": "Error",
"code": 7039
},
"If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{0}`": {
"If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}`": {
"category": "Error",
"code": 7040
},