@@ -189,14 +189,15 @@ module.exports = {
189
189
return ;
190
190
}
191
191
192
- if ( node . type === 'CallExpression'
193
- && node . callee
194
- && node . callee . type === 'MemberExpression'
195
- && node . callee . object
196
- && isArrayIndex ( node . callee . object )
197
- && node . callee . property
198
- && node . callee . property . type === 'Identifier'
199
- && node . callee . property . name === 'toString'
192
+ if (
193
+ node . type === 'CallExpression'
194
+ && node . callee
195
+ && node . callee . type === 'MemberExpression'
196
+ && node . callee . object
197
+ && isArrayIndex ( node . callee . object )
198
+ && node . callee . property
199
+ && node . callee . property . type === 'Identifier'
200
+ && node . callee . property . name === 'toString'
200
201
) {
201
202
// key={bar.toString()}
202
203
report ( context , messages . noArrayIndex , 'noArrayIndex' , {
@@ -205,13 +206,14 @@ module.exports = {
205
206
return ;
206
207
}
207
208
208
- if ( node . type === 'CallExpression'
209
- && node . callee
210
- && node . callee . type === 'Identifier'
211
- && node . callee . name === 'String'
212
- && Array . isArray ( node . arguments )
213
- && node . arguments . length > 0
214
- && isArrayIndex ( node . arguments [ 0 ] )
209
+ if (
210
+ node . type === 'CallExpression'
211
+ && node . callee
212
+ && node . callee . type === 'Identifier'
213
+ && node . callee . name === 'String'
214
+ && Array . isArray ( node . arguments )
215
+ && node . arguments . length > 0
216
+ && isArrayIndex ( node . arguments [ 0 ] )
215
217
) {
216
218
// key={String(bar)}
217
219
report ( context , messages . noArrayIndex , 'noArrayIndex' , {
0 commit comments