File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ module.exports = {
435
435
const componentComments = [ ]
436
436
const foundNodes = [ ]
437
437
438
- function hasNode ( node ) {
438
+ function isDuplicateNode ( node ) {
439
439
return foundNodes . some ( el => el . loc . start . line === node . loc . start . line )
440
440
}
441
441
@@ -451,18 +451,18 @@ module.exports = {
451
451
componentComments . push ( node )
452
452
} ,
453
453
ObjectExpression ( node ) {
454
- if ( ! componentComments . some ( el => el . loc . end . line === node . loc . start . line - 1 ) || hasNode ( node ) ) return
454
+ if ( ! componentComments . some ( el => el . loc . end . line === node . loc . start . line - 1 ) || isDuplicateNode ( node ) ) return
455
455
foundNodes . push ( node )
456
456
cb ( node )
457
457
} ,
458
458
'ExportDefaultDeclaration:exit' ( node ) {
459
459
// export default {} in .vue || .jsx
460
- if ( ! _this . isVueComponentFile ( node , filePath , context ) || hasNode ( node ) ) return
460
+ if ( ! _this . isVueComponentFile ( node , filePath ) || isDuplicateNode ( node ) ) return
461
461
cb ( node . declaration )
462
462
} ,
463
463
'CallExpression:exit' ( node ) {
464
464
// Vue.component('xxx', {}) || component('xxx', {})
465
- if ( ! _this . isVueComponent ( node ) || foundNodes . some ( el => el . loc . start . line === node . loc . start . line ) ) return
465
+ if ( ! _this . isVueComponent ( node ) || isDuplicateNode ( node ) ) return
466
466
cb ( node . arguments . slice ( - 1 ) [ 0 ] )
467
467
}
468
468
}
You can’t perform that action at this time.
0 commit comments