The actual snapshot is saved in prefer-set-size.mjs.snap
.
Generated by AVA.
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\`.␊
`
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\`.␊
`
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 | }␊
`
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\`.␊
`
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\`.␊
`
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\`.␊
`
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\`.␊
`
1 | [/* comment */...new Set(array)].length
Error 1/1
`␊
> 1 | [/* comment */...new Set(array)].length␊
| ^^^^^^ Prefer use \`Set#size\` instead of \`Array#length\`.␊
`
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\`.␊
`