The actual snapshot is saved in prefer-array-some.js.snap
.
Generated by AVA.
Snapshot 1
`␊
Error 1/1:␊
> 1 | if (array.find(element => element === "🦄")) {}␊
| ^^^^ Prefer `.some(…)` over `.find(…)`.␊
`
Snapshot 1
`␊
Error 1/1:␊
> 1 | const foo = array.find(element => element === "🦄") ? bar : baz;␊
| ^^^^ Prefer `.some(…)` over `.find(…)`.␊
`
Snapshot 1
`␊
Error 1/3:␊
1 | if (␊
2 | array␊
3 | /* correct */.find(element => Array.isArray(element))␊
> 4 | /* incorrect */.find(element => element/* incorrect */.find(fn) ? 1 : 0)␊
| ^^^^ Prefer `.some(…)` over `.find(…)`.␊
5 | ) {␊
6 | console.log(jQuery/* correct */.find('div'));␊
7 | } else {␊
8 | console.log(array/* incorrect */.find(fn) ? 'yes' : 'no');␊
9 | }␊
Error 2/3:␊
1 | if (␊
2 | array␊
3 | /* correct */.find(element => Array.isArray(element))␊
> 4 | /* incorrect */.find(element => element/* incorrect */.find(fn) ? 1 : 0)␊
| ^^^^ Prefer `.some(…)` over `.find(…)`.␊
5 | ) {␊
6 | console.log(jQuery/* correct */.find('div'));␊
7 | } else {␊
8 | console.log(array/* incorrect */.find(fn) ? 'yes' : 'no');␊
9 | }␊
Error 3/3:␊
1 | if (␊
2 | array␊
3 | /* correct */.find(element => Array.isArray(element))␊
4 | /* incorrect */.find(element => element/* incorrect */.find(fn) ? 1 : 0)␊
5 | ) {␊
6 | console.log(jQuery/* correct */.find('div'));␊
7 | } else {␊
> 8 | console.log(array/* incorrect */.find(fn) ? 'yes' : 'no');␊
| ^^^^ Prefer `.some(…)` over `.find(…)`.␊
9 | }␊
`