Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 1.71 KB

prefer-destructuring-in-parameters.js.md

File metadata and controls

85 lines (58 loc) · 1.71 KB

Snapshot report for test/prefer-destructuring-in-parameters.js

The actual snapshot is saved in prefer-destructuring-in-parameters.js.snap.

Generated by AVA.

Invalid #1

  1 | const foo = bar => bar[0]

Output

`␊
  1 | const foo = ([firstElementOfBar]) => firstElementOfBar␊
`

Error 1/1

`␊
> 1 | const foo = bar => bar[0]␊
    |                    ^^^^^^ `bar[0]` should be destructed in parameter `bar`.␊
`

Invalid #2

  1 | const foo = bar => bar[0] === firstElementOfBar

Output

`␊
  1 | const foo = ([firstElementOfBar_]) => firstElementOfBar_ === firstElementOfBar␊
`

Error 1/1

`␊
> 1 | const foo = bar => bar[0] === firstElementOfBar␊
    |                    ^^^^^^ `bar[0]` should be destructed in parameter `bar`.␊
`

Invalid #3

  1 | const foo = bar => bar[0b01]

Output

`␊
  1 | const foo = ([, secondElementOfBar]) => secondElementOfBar␊
`

Error 1/1

`␊
> 1 | const foo = bar => bar[0b01]␊
    |                    ^^^^^^^^^ `bar[1]` should be destructed in parameter `bar`.␊
`

Invalid #4

  1 | const foo = bar => bar.length

Output

`␊
  1 | const foo = ({length}) => length␊
`

Error 1/1

`␊
> 1 | const foo = bar => bar.length␊
    |                    ^^^^^^^^^^ `bar.length` should be destructed in parameter `bar`.␊
`

Invalid #5

  1 | const foo = bar => bar.baz

Output

`␊
  1 | const foo = ({baz}) => baz␊
`

Error 1/1

`␊
> 1 | const foo = bar => bar.baz␊
    |                    ^^^^^^^ `bar.baz` should be destructed in parameter `bar`.␊
`