Skip to content

Latest commit

 

History

History
65 lines (54 loc) · 2.07 KB

prefer-array-some.js.md

File metadata and controls

65 lines (54 loc) · 2.07 KB

Snapshot report for test/prefer-array-some.js

The actual snapshot is saved in prefer-array-some.js.snap.

Generated by AVA.

prefer-array-some - #1

Snapshot 1

`␊
Error 1/1:␊
> 1 | if (array.find(element => element === "🦄")) {}␊
    |           ^^^^ Prefer `.some()` over `.find()`.␊
`

prefer-array-some - #2

Snapshot 1

`␊
Error 1/1:␊
> 1 | const foo = array.find(element => element === "🦄") ? bar : baz;␊
    |                   ^^^^ Prefer `.some()` over `.find()`.␊
`

prefer-array-some - #3

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 | }␊
`