MCPcopy Create free account
hub / github.com/nodejs/node / reportInvalidImportEqualsExportMember

Function reportInvalidImportEqualsExportMember

test/fixtures/snapshot/typescript.js:50693–50711  ·  view source on GitHub ↗
(node, name, declarationName, moduleName)

Source from the content-addressed store, hash-verified

50691 }
50692 }
50693 function reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) {
50694 if (moduleKind >= ts.ModuleKind.ES2015) {
50695 var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_a_default_import :
50696 ts.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
50697 error(name, message, declarationName);
50698 }
50699 else {
50700 if (ts.isInJSFile(node)) {
50701 var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import :
50702 ts.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
50703 error(name, message, declarationName);
50704 }
50705 else {
50706 var message = ts.getESModuleInterop(compilerOptions) ? ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import :
50707 ts.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import;
50708 error(name, message, declarationName, declarationName, moduleName);
50709 }
50710 }
50711 }
50712 function getTargetOfImportSpecifier(node, dontResolveAlias) {
50713 var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent;
50714 var commonJSPropertyAccess = getCommonJSPropertyAccess(root);

Callers 1

reportNonExportedMemberFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected