@@ -75,18 +75,6 @@ module.exports = Components.detect(function(context, components) {
7575 }
7676 } , context . options [ 0 ] ) ;
7777
78- /**
79- * Checks if the component must be validated
80- * @param {Object } component The component to process
81- * @returns {Boolean } True if the component must be validated, false if not.
82- */
83- function mustBeValidated ( component ) {
84- return (
85- component &&
86- ! component . hasDisplayName
87- ) ;
88- }
89-
9078 // --------------------------------------------------------------------------
9179 // Public
9280 // --------------------------------------------------------------------------
@@ -236,10 +224,14 @@ module.exports = Components.detect(function(context, components) {
236224 * @returns {Array } Properties array.
237225 */
238226 function getComponentProperties ( node ) {
239- if ( node . type === 'ClassDeclaration' ) {
240- return node . body . body ;
227+ switch ( node . type ) {
228+ case 'ClassDeclaration' :
229+ return node . body . body ;
230+ case 'ObjectExpression' :
231+ return node . properties ;
232+ default :
233+ return [ ] ;
241234 }
242- return node . properties ;
243235 }
244236
245237 /**
@@ -346,7 +338,7 @@ module.exports = Components.detect(function(context, components) {
346338 'Program:exit' : function ( ) {
347339 var list = components . list ( ) ;
348340 for ( var component in list ) {
349- if ( ! list . hasOwnProperty ( component ) || ! mustBeValidated ( list [ component ] ) ) {
341+ if ( ! list . hasOwnProperty ( component ) ) {
350342 continue ;
351343 }
352344 var properties = getComponentProperties ( list [ component ] . node ) ;
0 commit comments