File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ module.exports = {
116116 }
117117
118118 const jsxElements = [ ] ;
119- const fragmentNames = [ `${ reactPragma } .${ fragmentPragma } ` ] ;
119+ const fragmentNames = new Set ( [ `${ reactPragma } .${ fragmentPragma } ` ] ) ;
120120
121121 // --------------------------------------------------------------------------
122122 // Public
@@ -146,7 +146,7 @@ module.exports = {
146146 node . specifiers . forEach ( spec => {
147147 if ( spec . imported && spec . imported . name === fragmentPragma ) {
148148 if ( spec . local ) {
149- fragmentNames . push ( spec . local . name ) ;
149+ fragmentNames . add ( spec . local . name ) ;
150150 }
151151 }
152152 } ) ;
@@ -158,7 +158,7 @@ module.exports = {
158158 const openingEl = node . openingElement ;
159159 const elName = elementType ( openingEl ) ;
160160
161- if ( fragmentNames . indexOf ( elName ) !== - 1 || refersToReactFragment ( elName ) ) {
161+ if ( fragmentNames . has ( elName ) || refersToReactFragment ( elName ) ) {
162162 if ( reportOnReactVersion ( node ) ) {
163163 return ;
164164 }
You can’t perform that action at this time.
0 commit comments