From 73883f47b51a6be62c6f8a78977337334c5890cb Mon Sep 17 00:00:00 2001 From: Joel <68335961+hjoelh@users.noreply.github.com> Date: Tue, 15 Aug 2023 16:39:09 +0100 Subject: [PATCH] tidy --- lib/rules/no-uninstalled-addons.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/rules/no-uninstalled-addons.ts b/lib/rules/no-uninstalled-addons.ts index 6ae43bc..bfb1cdc 100644 --- a/lib/rules/no-uninstalled-addons.ts +++ b/lib/rules/no-uninstalled-addons.ts @@ -252,18 +252,9 @@ export = createStorybookRule({ }, ExportDefaultDeclaration: function (node) { const meta = getMetaObjectExpression(node, context) - if (!meta) { - return null - } - - const addonsProp = meta.properties.find( - (prop): prop is TSESTree.Property => - isProperty(prop) && isIdentifier(prop.key) && prop.key.name === 'addons' - ) + if (!meta) return null - if (addonsProp && addonsProp.value && isArrayExpression(addonsProp.value)) { - reportUninstalledAddons(addonsProp.value) - } + findAddonsPropAndReport(meta) }, ExportNamedDeclaration: function (node) { const addonsProp =