From 5eaf934fa785b072700717f7c726710857efb5e8 Mon Sep 17 00:00:00 2001 From: nrgnrg Date: Thu, 10 Feb 2022 17:48:49 +0000 Subject: [PATCH] fix: test failures --- rules/prefer-export-from.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/prefer-export-from.js b/rules/prefer-export-from.js index 80c03ba8d0..fefda0f14d 100644 --- a/rules/prefer-export-from.js +++ b/rules/prefer-export-from.js @@ -109,8 +109,8 @@ function getFixFunction({ const sourceNode = importDeclaration.source; const sourceValue = sourceNode.value; const exportDeclaration = exportDeclarations.find(({source}) => source.value === sourceValue); - const isTypeExport = exported.node.parent.exportKind === "type" - const isTypeExportDeclaration = exportDeclaration?.exportKind === "type" + const isTypeExport = exported.node.parent.exportKind === 'type'; + const isTypeExportDeclaration = 'exportKind' in exportDeclaration && exportDeclaration.exportKind === 'type'; /** @param {import('eslint').Rule.RuleFixer} fixer */ return function * (fixer) { @@ -124,7 +124,7 @@ function getFixFunction({ ? exported.text : `${imported.text} as ${exported.text}`; - const specifierWithKind = isTypeExport ? `type ${specifier}` : specifier + const specifierWithKind = isTypeExport ? `type ${specifier}` : specifier; if (exportDeclaration && !isTypeExportDeclaration) { const lastSpecifier = exportDeclaration.specifiers[exportDeclaration.specifiers.length - 1];