Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 031fdf1

Browse filesBrowse files
committed
addressed PR feedback
1 parent 98f3163 commit 031fdf1
Copy full SHA for 031fdf1

4 files changed

+12-12Lines changed: 12 additions & 12 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/diagnosticInformationMap.generated.ts‎

Copy file name to clipboardExpand all lines: src/compiler/diagnosticInformationMap.generated.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ namespace ts {
427427
Cannot_emit_namespaced_JSX_elements_in_React: { code: 2650, category: DiagnosticCategory.Error, key: "Cannot emit namespaced JSX elements in React" },
428428
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: { code: 2651, category: DiagnosticCategory.Error, key: "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums." },
429429
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: { code: 2652, category: DiagnosticCategory.Error, key: "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead." },
430-
Proper_external_module_that_carries_external_typings_cannot_contain_tripleslash_references: { code: 2654, category: DiagnosticCategory.Error, key: "Proper external module that carries external typings cannot contain tripleslash references." },
431-
Proper_external_module_that_carries_external_typings_should_be_d_ts_file: { code: 2655, category: DiagnosticCategory.Error, key: "Proper external module that carries external typings should be '.d.ts' file." },
430+
Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: { code: 2654, category: DiagnosticCategory.Error, key: "Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition." },
431+
Exported_external_package_typings_can_only_be_in_d_ts_files_Please_contact_the_package_author_to_update_the_package_definition: { code: 2655, category: DiagnosticCategory.Error, key: "Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition." },
432432
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
433433
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
434434
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
Collapse file

‎src/compiler/diagnosticMessages.json‎

Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,11 +1697,11 @@
16971697
"category": "Error",
16981698
"code": 2652
16991699
},
1700-
"Proper external module that carries external typings cannot contain tripleslash references.": {
1700+
"Exported external package typings file cannot contain tripleslash references. Please contact the package author to update the package definition.": {
17011701
"category": "Error",
17021702
"code": 2654
17031703
},
1704-
"Proper external module that carries external typings should be '.d.ts' file.": {
1704+
"Exported external package typings can only be in '.d.ts' files. Please contact the package author to update the package definition.": {
17051705
"category": "Error",
17061706
"code": 2655
17071707
},
Collapse file

‎src/compiler/program.ts‎

Copy file name to clipboardExpand all lines: src/compiler/program.ts
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ namespace ts {
129129
let candidate = normalizePath(combinePaths(nodeModulesFolder, moduleName));
130130
let result = loadNodeModuleFromFile(candidate, /* loadOnlyDts */ true, failedLookupLocations, host);
131131
if (result) {
132-
return { resolvedModule: { resolvedFileName: result, shouldBeProperExternalModule: true }, failedLookupLocations };
132+
return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations };
133133
}
134134

135135
result = loadNodeModuleFromDirectory(candidate, /* loadOnlyDts */ true, failedLookupLocations, host);
136136
if (result) {
137-
return { resolvedModule: { resolvedFileName: result, shouldBeProperExternalModule: true }, failedLookupLocations };
137+
return { resolvedModule: { resolvedFileName: result, isExternalLibraryImport: true }, failedLookupLocations };
138138
}
139139
}
140140

@@ -475,7 +475,7 @@ namespace ts {
475475
let resolutionChanged = oldResolution
476476
? !newResolution ||
477477
oldResolution.resolvedFileName !== newResolution.resolvedFileName ||
478-
!!oldResolution.shouldBeProperExternalModule !== !!newResolution.shouldBeProperExternalModule
478+
!!oldResolution.isExternalLibraryImport !== !!newResolution.isExternalLibraryImport
479479
: newResolution;
480480

481481
if (resolutionChanged) {
@@ -860,18 +860,18 @@ namespace ts {
860860
setResolvedModule(file, moduleNames[i], resolution);
861861
if (resolution && !options.noResolve) {
862862
const importedFile = findModuleSourceFile(resolution.resolvedFileName, file.imports[i]);
863-
if (importedFile && resolution.shouldBeProperExternalModule) {
863+
if (importedFile && resolution.isExternalLibraryImport) {
864864
if (!isExternalModule(importedFile)) {
865865
let start = getTokenPosOfNode(file.imports[i], file)
866866
diagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.File_0_is_not_a_module, importedFile.fileName));
867867
}
868868
else if (!fileExtensionIs(importedFile.fileName, ".d.ts")) {
869869
let start = getTokenPosOfNode(file.imports[i], file)
870-
diagnostics.add(createFileDiagnostic(file, start, file.imports[i].end - start, Diagnostics.Proper_external_module_that_carries_external_typings_should_be_d_ts_file));
870+
diagnostics.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));
871871
}
872872
else if (importedFile.referencedFiles.length) {
873873
let firstRef = importedFile.referencedFiles[0];
874-
diagnostics.add(createFileDiagnostic(importedFile, firstRef.pos, firstRef.end - firstRef.pos, Diagnostics.Proper_external_module_that_carries_external_typings_cannot_contain_tripleslash_references));
874+
diagnostics.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));
875875
}
876876
}
877877
}
Collapse file

‎src/compiler/types.ts‎

Copy file name to clipboardExpand all lines: src/compiler/types.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,12 +2284,12 @@ namespace ts {
22842284
export interface ResolvedModule {
22852285
resolvedFileName: string;
22862286
/*
2287-
* Denotes if 'resolvedFileName' should be proper external module:
2287+
* Denotes if 'resolvedFileName' is isExternalLibraryImport and thus should be proper external module:
22882288
* - be a .d.ts file
22892289
* - use top level imports\exports
22902290
* - don't use tripleslash references
22912291
*/
2292-
shouldBeProperExternalModule?: boolean;
2292+
isExternalLibraryImport?: boolean;
22932293
}
22942294

22952295
export interface ResolvedModuleWithFailedLookupLocations {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.