Skip to content

Latest commit

 

History

History
155 lines (110 loc) · 3.03 KB

prefer-set-size.mjs.md

File metadata and controls

155 lines (110 loc) · 3.03 KB

Snapshot report for test/prefer-set-size.mjs

The actual snapshot is saved in prefer-set-size.mjs.snap.

Generated by AVA.

Invalid #1

  1 | [...new Set(array)].length

Output

`␊
  1 | new Set(array).size␊
`

Error 1/1

`␊
> 1 | [...new Set(array)].length␊
    |                     ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #2

  1 | const foo = new Set([]);
  2 | console.log([...foo].length);

Output

`␊
  1 | const foo = new Set([]);␊
  2 | console.log(foo.size);␊
`

Error 1/1

`␊
  1 | const foo = new Set([]);␊
> 2 | console.log([...foo].length);␊
    |                      ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #3

  1 | function isUnique(array) {
  2 | 	return[...new Set(array)].length === array.length
  3 | }

Output

`␊
  1 | function isUnique(array) {␊
  2 | 	return new Set(array).size === array.length␊
  3 | }␊
`

Error 1/1

`␊
  1 | function isUnique(array) {␊
> 2 | 	return[...new Set(array)].length === array.length␊
    | 	                          ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
  3 | }␊
`

Invalid #4

  1 | [...new Set(array),].length

Output

`␊
  1 | new Set(array).size␊
`

Error 1/1

`␊
> 1 | [...new Set(array),].length␊
    |                      ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #5

  1 | [...(( new Set(array) ))].length

Output

`␊
  1 | new Set(array).size␊
`

Error 1/1

`␊
> 1 | [...(( new Set(array) ))].length␊
    |                           ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #6

  1 | (( [...new Set(array)] )).length

Output

`␊
  1 | (( new Set(array) )).size␊
`

Error 1/1

`␊
> 1 | (( [...new Set(array)] )).length␊
    |                           ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #7

  1 | foo
  2 | ;[...new Set(array)].length

Output

`␊
  1 | foo␊
  2 | ;new Set(array).size␊
`

Error 1/1

`␊
  1 | foo␊
> 2 | ;[...new Set(array)].length␊
    |                      ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #8

  1 | [/* comment */...new Set(array)].length

Error 1/1

`␊
> 1 | [/* comment */...new Set(array)].length␊
    |                                  ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`

Invalid #9

  1 | [...new /* comment */ Set(array)].length

Output

`␊
  1 | new /* comment */ Set(array).size␊
`

Error 1/1

`␊
> 1 | [...new /* comment */ Set(array)].length␊
    |                                   ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`