The actual snapshot is saved in prefer-includes.js.snap
.
Generated by AVA.
1 | 'foobar'.indexOf('foo') !== -1
Output
`␊
1 | 'foobar'.includes('foo')␊
`
Error 1/1
`␊
> 1 | 'foobar'.indexOf('foo') !== -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | str.indexOf('foo') != -1
Output
`␊
1 | str.includes('foo')␊
`
Error 1/1
`␊
> 1 | str.indexOf('foo') != -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | str.indexOf('foo') > -1
Output
`␊
1 | str.includes('foo')␊
`
Error 1/1
`␊
> 1 | str.indexOf('foo') > -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | str.indexOf('foo') == -1
Output
`␊
1 | !str.includes('foo')␊
`
Error 1/1
`␊
> 1 | str.indexOf('foo') == -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | 'foobar'.indexOf('foo') >= 0
Output
`␊
1 | 'foobar'.includes('foo')␊
`
Error 1/1
`␊
> 1 | 'foobar'.indexOf('foo') >= 0␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | [1,2,3].indexOf(4) !== -1
Output
`␊
1 | [1,2,3].includes(4)␊
`
Error 1/1
`␊
> 1 | [1,2,3].indexOf(4) !== -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | str.indexOf('foo') < 0
Output
`␊
1 | !str.includes('foo')␊
`
Error 1/1
`␊
> 1 | str.indexOf('foo') < 0␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | ''.indexOf('foo') < 0
Output
`␊
1 | !''.includes('foo')␊
`
Error 1/1
`␊
> 1 | ''.indexOf('foo') < 0␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | (a || b).indexOf('foo') === -1
Output
`␊
1 | !(a || b).includes('foo')␊
`
Error 1/1
`␊
> 1 | (a || b).indexOf('foo') === -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | foo.indexOf(bar, 0) !== -1
Output
`␊
1 | foo.includes(bar)␊
`
Error 1/1
`␊
> 1 | foo.indexOf(bar, 0) !== -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`
1 | foo.indexOf(bar, 1) !== -1
Output
`␊
1 | foo.includes(bar, 1)␊
`
Error 1/1
`␊
> 1 | foo.indexOf(bar, 1) !== -1␊
| ^^^^^^^ Use `.includes()`, rather than `.indexOf()`, when checking for existence.␊
`