@@ -45,7 +45,7 @@ function findPropertyWithName(name, propertyArray) {
4545// Does a component contain the right property? e.g. key, version
4646function componentContainsPropertyCheck ( context , node , propertyName , message ) {
4747 let component ;
48- if ( isDefaultExport ( node ) ) {
48+ if ( isDefaultExport ( node ) && isObjectWithProperties ( node . declaration ) ) {
4949 component = node . declaration ;
5050 }
5151
@@ -81,7 +81,7 @@ function getProps(moduleProperties) {
8181// Do component props contain the right properties? e.g. label, description
8282function componentPropsContainsPropertyCheck ( context , node , propertyName ) {
8383 let component ;
84- if ( isDefaultExport ( node ) ) {
84+ if ( isDefaultExport ( node ) && isObjectWithProperties ( node . declaration ) ) {
8585 component = node . declaration ;
8686 }
8787 if ( node . expression ) {
@@ -120,7 +120,7 @@ function componentPropsContainsPropertyCheck(context, node, propertyName) {
120120
121121function optionalComponentPropsHaveDefaultProperty ( context , node ) {
122122 let component ;
123- if ( isDefaultExport ( node ) ) {
123+ if ( isDefaultExport ( node ) && isObjectWithProperties ( node . declaration ) ) {
124124 component = node . declaration ;
125125 }
126126
@@ -167,7 +167,7 @@ function optionalComponentPropsHaveDefaultProperty(context, node) {
167167// the node with the name specified by the user
168168function checkComponentIsSourceAndReturnTargetProp ( node , propertyName ) {
169169 let component ;
170- if ( isDefaultExport ( node ) ) {
170+ if ( isDefaultExport ( node ) && isObjectWithProperties ( node . declaration ) ) {
171171 component = node . declaration ;
172172 }
173173
@@ -216,7 +216,7 @@ function componentSourceDescriptionCheck(context, node) {
216216
217217function componentVersionTsMacroCheck ( context , node ) {
218218 let component ;
219- if ( isDefaultExport ( node ) ) {
219+ if ( isDefaultExport ( node ) && isObjectWithProperties ( node . declaration ) ) {
220220 component = node . declaration ;
221221 }
222222
0 commit comments