Skip to content

Commit

Permalink
fix: test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
nrgnrg committed Feb 10, 2022
1 parent 8e6ce4a commit 5eaf934
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rules/prefer-export-from.js
Expand Up @@ -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) {
Expand All @@ -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];
Expand Down

0 comments on commit 5eaf934

Please sign in to comment.