@@ -46,7 +46,28 @@ Generated by [AVA](https://avajs.dev).
46
46
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
47
47
`
48
48
49
- ## invalid(3): str.indexOf('foo') != -1
49
+ ## invalid(3): <template ><div v-if =" 'foobar'.indexOf('foo') !== -1 " ></div ></template >
50
+
51
+ > Input
52
+
53
+ `␊
54
+ 1 | <template><div v-if="'foobar'.indexOf('foo') !== -1"></div></template>␊
55
+ `
56
+
57
+ > Output
58
+
59
+ `␊
60
+ 1 | <template><div v-if="'foobar'.includes('foo')"></div></template>␊
61
+ `
62
+
63
+ > Error 1/1
64
+
65
+ `␊
66
+ > 1 | <template><div v-if="'foobar'.indexOf('foo') !== -1"></div></template>␊
67
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
68
+ `
69
+
70
+ ## invalid(4): str.indexOf('foo') != -1
50
71
51
72
> Input
52
73
@@ -67,7 +88,7 @@ Generated by [AVA](https://avajs.dev).
67
88
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
68
89
`
69
90
70
- ## invalid(4 ): str.lastIndexOf('foo') != -1
91
+ ## invalid(5 ): str.lastIndexOf('foo') != -1
71
92
72
93
> Input
73
94
@@ -88,7 +109,28 @@ Generated by [AVA](https://avajs.dev).
88
109
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
89
110
`
90
111
91
- ## invalid(5): str.indexOf('foo') > -1
112
+ ## invalid(6): <template ><div v-if =" str.indexOf('foo') != -1 " ></div ></template >
113
+
114
+ > Input
115
+
116
+ `␊
117
+ 1 | <template><div v-if="str.indexOf('foo') != -1"></div></template>␊
118
+ `
119
+
120
+ > Output
121
+
122
+ `␊
123
+ 1 | <template><div v-if="str.includes('foo')"></div></template>␊
124
+ `
125
+
126
+ > Error 1/1
127
+
128
+ `␊
129
+ > 1 | <template><div v-if="str.indexOf('foo') != -1"></div></template>␊
130
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
131
+ `
132
+
133
+ ## invalid(7): str.indexOf('foo') > -1
92
134
93
135
> Input
94
136
@@ -109,7 +151,7 @@ Generated by [AVA](https://avajs.dev).
109
151
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
110
152
`
111
153
112
- ## invalid(6 ): str.lastIndexOf('foo') > -1
154
+ ## invalid(8 ): str.lastIndexOf('foo') > -1
113
155
114
156
> Input
115
157
@@ -130,7 +172,28 @@ Generated by [AVA](https://avajs.dev).
130
172
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
131
173
`
132
174
133
- ## invalid(7): str.indexOf('foo') == -1
175
+ ## invalid(9): <template ><div v-if =" str.indexOf('foo') > -1 " ></div ></template >
176
+
177
+ > Input
178
+
179
+ `␊
180
+ 1 | <template><div v-if="str.indexOf('foo') > -1"></div></template>␊
181
+ `
182
+
183
+ > Output
184
+
185
+ `␊
186
+ 1 | <template><div v-if="str.includes('foo')"></div></template>␊
187
+ `
188
+
189
+ > Error 1/1
190
+
191
+ `␊
192
+ > 1 | <template><div v-if="str.indexOf('foo') > -1"></div></template>␊
193
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
194
+ `
195
+
196
+ ## invalid(10): str.indexOf('foo') == -1
134
197
135
198
> Input
136
199
@@ -151,7 +214,7 @@ Generated by [AVA](https://avajs.dev).
151
214
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
152
215
`
153
216
154
- ## invalid(8 ): str.lastIndexOf('foo') == -1
217
+ ## invalid(11 ): str.lastIndexOf('foo') == -1
155
218
156
219
> Input
157
220
@@ -172,7 +235,28 @@ Generated by [AVA](https://avajs.dev).
172
235
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
173
236
`
174
237
175
- ## invalid(9): 'foobar'.indexOf('foo') >= 0
238
+ ## invalid(12): <template ><div v-if =" str.indexOf('foo') == -1 " ></div ></template >
239
+
240
+ > Input
241
+
242
+ `␊
243
+ 1 | <template><div v-if="str.indexOf('foo') == -1"></div></template>␊
244
+ `
245
+
246
+ > Output
247
+
248
+ `␊
249
+ 1 | <template><div v-if="!str.includes('foo')"></div></template>␊
250
+ `
251
+
252
+ > Error 1/1
253
+
254
+ `␊
255
+ > 1 | <template><div v-if="str.indexOf('foo') == -1"></div></template>␊
256
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
257
+ `
258
+
259
+ ## invalid(13): 'foobar'.indexOf('foo') >= 0
176
260
177
261
> Input
178
262
@@ -193,7 +277,7 @@ Generated by [AVA](https://avajs.dev).
193
277
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
194
278
`
195
279
196
- ## invalid(10 ): 'foobar'.lastIndexOf('foo') >= 0
280
+ ## invalid(14 ): 'foobar'.lastIndexOf('foo') >= 0
197
281
198
282
> Input
199
283
@@ -214,7 +298,28 @@ Generated by [AVA](https://avajs.dev).
214
298
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
215
299
`
216
300
217
- ## invalid(11): [ 1,2,3] .indexOf(4) !== -1
301
+ ## invalid(15): <template ><div v-if =" 'foobar'.indexOf('foo') >= 0 " ></div ></template >
302
+
303
+ > Input
304
+
305
+ `␊
306
+ 1 | <template><div v-if="'foobar'.indexOf('foo') >= 0"></div></template>␊
307
+ `
308
+
309
+ > Output
310
+
311
+ `␊
312
+ 1 | <template><div v-if="'foobar'.includes('foo')"></div></template>␊
313
+ `
314
+
315
+ > Error 1/1
316
+
317
+ `␊
318
+ > 1 | <template><div v-if="'foobar'.indexOf('foo') >= 0"></div></template>␊
319
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
320
+ `
321
+
322
+ ## invalid(16): [ 1,2,3] .indexOf(4) !== -1
218
323
219
324
> Input
220
325
@@ -235,7 +340,7 @@ Generated by [AVA](https://avajs.dev).
235
340
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
236
341
`
237
342
238
- ## invalid(12 ): [ 1,2,3] .lastIndexOf(4) !== -1
343
+ ## invalid(17 ): [ 1,2,3] .lastIndexOf(4) !== -1
239
344
240
345
> Input
241
346
@@ -256,7 +361,28 @@ Generated by [AVA](https://avajs.dev).
256
361
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
257
362
`
258
363
259
- ## invalid(13): str.indexOf('foo') < 0
364
+ ## invalid(18): <template ><div v-if =" [1,2,3].indexOf(4) !== -1 " ></div ></template >
365
+
366
+ > Input
367
+
368
+ `␊
369
+ 1 | <template><div v-if="[1,2,3].indexOf(4) !== -1"></div></template>␊
370
+ `
371
+
372
+ > Output
373
+
374
+ `␊
375
+ 1 | <template><div v-if="[1,2,3].includes(4)"></div></template>␊
376
+ `
377
+
378
+ > Error 1/1
379
+
380
+ `␊
381
+ > 1 | <template><div v-if="[1,2,3].indexOf(4) !== -1"></div></template>␊
382
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
383
+ `
384
+
385
+ ## invalid(19): str.indexOf('foo') < 0
260
386
261
387
> Input
262
388
@@ -277,7 +403,7 @@ Generated by [AVA](https://avajs.dev).
277
403
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
278
404
`
279
405
280
- ## invalid(14 ): str.lastIndexOf('foo') < 0
406
+ ## invalid(20 ): str.lastIndexOf('foo') < 0
281
407
282
408
> Input
283
409
@@ -298,7 +424,28 @@ Generated by [AVA](https://avajs.dev).
298
424
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
299
425
`
300
426
301
- ## invalid(15): ''.indexOf('foo') < 0
427
+ ## invalid(21): <template ><div v-if =" str.indexOf('foo') < 0 " ></div ></template >
428
+
429
+ > Input
430
+
431
+ `␊
432
+ 1 | <template><div v-if="str.indexOf('foo') < 0"></div></template>␊
433
+ `
434
+
435
+ > Output
436
+
437
+ `␊
438
+ 1 | <template><div v-if="!str.includes('foo')"></div></template>␊
439
+ `
440
+
441
+ > Error 1/1
442
+
443
+ `␊
444
+ > 1 | <template><div v-if="str.indexOf('foo') < 0"></div></template>␊
445
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
446
+ `
447
+
448
+ ## invalid(22): ''.indexOf('foo') < 0
302
449
303
450
> Input
304
451
@@ -319,7 +466,7 @@ Generated by [AVA](https://avajs.dev).
319
466
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
320
467
`
321
468
322
- ## invalid(16 ): ''.lastIndexOf('foo') < 0
469
+ ## invalid(23 ): ''.lastIndexOf('foo') < 0
323
470
324
471
> Input
325
472
@@ -340,7 +487,28 @@ Generated by [AVA](https://avajs.dev).
340
487
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
341
488
`
342
489
343
- ## invalid(17): (a || b).indexOf('foo') === -1
490
+ ## invalid(24): <template ><div v-if =" ''.indexOf('foo') < 0 " ></div ></template >
491
+
492
+ > Input
493
+
494
+ `␊
495
+ 1 | <template><div v-if="''.indexOf('foo') < 0"></div></template>␊
496
+ `
497
+
498
+ > Output
499
+
500
+ `␊
501
+ 1 | <template><div v-if="!''.includes('foo')"></div></template>␊
502
+ `
503
+
504
+ > Error 1/1
505
+
506
+ `␊
507
+ > 1 | <template><div v-if="''.indexOf('foo') < 0"></div></template>␊
508
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
509
+ `
510
+
511
+ ## invalid(25): (a || b).indexOf('foo') === -1
344
512
345
513
> Input
346
514
@@ -361,7 +529,7 @@ Generated by [AVA](https://avajs.dev).
361
529
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
362
530
`
363
531
364
- ## invalid(18 ): (a || b).lastIndexOf('foo') === -1
532
+ ## invalid(26 ): (a || b).lastIndexOf('foo') === -1
365
533
366
534
> Input
367
535
@@ -382,7 +550,28 @@ Generated by [AVA](https://avajs.dev).
382
550
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
383
551
`
384
552
385
- ## invalid(19): foo.indexOf(bar, 0) !== -1
553
+ ## invalid(27): <template ><div v-if =" (a || b).indexOf('foo') === -1 " ></div ></template >
554
+
555
+ > Input
556
+
557
+ `␊
558
+ 1 | <template><div v-if="(a || b).indexOf('foo') === -1"></div></template>␊
559
+ `
560
+
561
+ > Output
562
+
563
+ `␊
564
+ 1 | <template><div v-if="!(a || b).includes('foo')"></div></template>␊
565
+ `
566
+
567
+ > Error 1/1
568
+
569
+ `␊
570
+ > 1 | <template><div v-if="(a || b).indexOf('foo') === -1"></div></template>␊
571
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
572
+ `
573
+
574
+ ## invalid(28): foo.indexOf(bar, 0) !== -1
386
575
387
576
> Input
388
577
@@ -403,7 +592,7 @@ Generated by [AVA](https://avajs.dev).
403
592
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
404
593
`
405
594
406
- ## invalid(20 ): foo.lastIndexOf(bar, 0) !== -1
595
+ ## invalid(29 ): foo.lastIndexOf(bar, 0) !== -1
407
596
408
597
> Input
409
598
@@ -424,7 +613,28 @@ Generated by [AVA](https://avajs.dev).
424
613
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
425
614
`
426
615
427
- ## invalid(21): foo.indexOf(bar, 1) !== -1
616
+ ## invalid(30): <template ><div v-if =" foo.indexOf(bar, 0) !== -1 " ></div ></template >
617
+
618
+ > Input
619
+
620
+ `␊
621
+ 1 | <template><div v-if="foo.indexOf(bar, 0) !== -1"></div></template>␊
622
+ `
623
+
624
+ > Output
625
+
626
+ `␊
627
+ 1 | <template><div v-if="foo.includes(bar)"></div></template>␊
628
+ `
629
+
630
+ > Error 1/1
631
+
632
+ `␊
633
+ > 1 | <template><div v-if="foo.indexOf(bar, 0) !== -1"></div></template>␊
634
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
635
+ `
636
+
637
+ ## invalid(31): foo.indexOf(bar, 1) !== -1
428
638
429
639
> Input
430
640
@@ -445,7 +655,7 @@ Generated by [AVA](https://avajs.dev).
445
655
| ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
446
656
`
447
657
448
- ## invalid(22 ): foo.lastIndexOf(bar, 1) !== -1
658
+ ## invalid(32 ): foo.lastIndexOf(bar, 1) !== -1
449
659
450
660
> Input
451
661
@@ -466,6 +676,27 @@ Generated by [AVA](https://avajs.dev).
466
676
| ^^^^^^^^^^^ Use \`.includes()\`, rather than \`.lastIndexOf()\`, when checking for existence.␊
467
677
`
468
678
679
+ ## invalid(33): <template ><div v-if =" foo.indexOf(bar, 1) !== -1 " ></div ></template >
680
+
681
+ > Input
682
+
683
+ `␊
684
+ 1 | <template><div v-if="foo.indexOf(bar, 1) !== -1"></div></template>␊
685
+ `
686
+
687
+ > Output
688
+
689
+ `␊
690
+ 1 | <template><div v-if="foo.includes(bar, 1)"></div></template>␊
691
+ `
692
+
693
+ > Error 1/1
694
+
695
+ `␊
696
+ > 1 | <template><div v-if="foo.indexOf(bar, 1) !== -1"></div></template>␊
697
+ | ^^^^^^^ Use \`.includes()\`, rather than \`.indexOf()\`, when checking for existence.␊
698
+ `
699
+
469
700
## invalid(1): values.some(x => x === "foo")
470
701
471
702
> Input
0 commit comments