Skip to content

Latest commit

 

History

History
301 lines (239 loc) · 4.98 KB

no-useless-undefined.mjs.md

File metadata and controls

301 lines (239 loc) · 4.98 KB

Snapshot report for test/no-useless-undefined.mjs

The actual snapshot is saved in no-useless-undefined.mjs.snap.

Generated by AVA.

Invalid #1

  1 | foo(
  2 | 	undefined,
  3 | 	bar,
  4 | 	undefined,
  5 | 	undefined,
  6 | 	undefined,
  7 | 	undefined,
  8 | )

Output

`␊
  1 | foo(␊
  2 | 	undefined,␊
  3 | 	bar,␊
  4 | )␊
`

Error 1/1

`␊
  1 | foo(␊
  2 | 	undefined,␊
  3 | 	bar,␊
> 4 | 	undefined,␊
    | 	^^^^^^^^^^␊
> 5 | 	undefined,␊
    | ^^^^^^^^^^^␊
> 6 | 	undefined,␊
    | ^^^^^^^^^^^␊
> 7 | 	undefined,␊
    | ^^^^^^^^^^^ Do not use useless \`undefined\`.␊
  8 | )␊
`

Invalid #2

  1 | function foo([bar = undefined] = []) {}

Output

`␊
  1 | function foo([bar] = []) {}␊
`

Error 1/1

`␊
> 1 | function foo([bar = undefined] = []) {}␊
    |                     ^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #3

  1 | foo(bar, undefined, undefined);

Output

`␊
  1 | foo(bar);␊
`

Error 1/1

`␊
> 1 | foo(bar, undefined, undefined);␊
    |          ^^^^^^^^^^^^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #4

  1 | let a = undefined, b = 2;

Output

`␊
  1 | let a, b = 2;␊
`

Error 1/1

`␊
> 1 | let a = undefined, b = 2;␊
    |         ^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #5

   1 | function foo() {
   2 | 	return /* */ (
   3 | 		/* */
   4 | 		(
   5 | 			/* */
   6 | 			undefined
   7 | 			/* */
   8 | 		)
   9 | 		/* */
  10 | 	) /* */ ;
  11 | }

Output

`␊
   1 | function foo() {␊
   2 | 	return /* */␊
   3 | 		/* */␊
   4 |␊
   5 | 			/* */␊
   6 |␊
   7 | 			/* */␊
   8 |␊
   9 | 		/* */␊
  10 |  /* */ ;␊
  11 | }␊
`

Error 1/1

`␊
   1 | function foo() {␊
   2 | 	return /* */ (␊
   3 | 		/* */␊
   4 | 		(␊
   5 | 			/* */␊
>  6 | 			undefined␊
     | 			^^^^^^^^^ Do not use useless \`undefined\`.␊
   7 | 			/* */␊
   8 | 		)␊
   9 | 		/* */␊
  10 | 	) /* */ ;␊
  11 | }␊
`

Invalid #6

   1 | function * foo() {
   2 | 	yield /* */ (
   3 | 		/* */
   4 | 		(
   5 | 			/* */
   6 | 			undefined
   7 | 			/* */
   8 | 		)
   9 | 		/* */
  10 | 	) /* */ ;
  11 | }

Output

`␊
   1 | function * foo() {␊
   2 | 	yield /* */␊
   3 | 		/* */␊
   4 |␊
   5 | 			/* */␊
   6 |␊
   7 | 			/* */␊
   8 |␊
   9 | 		/* */␊
  10 |  /* */ ;␊
  11 | }␊
`

Error 1/1

`␊
   1 | function * foo() {␊
   2 | 	yield /* */ (␊
   3 | 		/* */␊
   4 | 		(␊
   5 | 			/* */␊
>  6 | 			undefined␊
     | 			^^^^^^^^^ Do not use useless \`undefined\`.␊
   7 | 			/* */␊
   8 | 		)␊
   9 | 		/* */␊
  10 | 	) /* */ ;␊
  11 | }␊
`

Invalid #7

  1 | const foo = () => /* */ (
  2 | 	/* */
  3 | 	(
  4 | 		/* */
  5 | 		undefined
  6 | 		/* */
  7 | 	)
  8 | 	/* */
  9 | );

Output

`␊
  1 | const foo = () => /* */␊
  2 | 	/* */␊
  3 |␊
  4 | 		/* */␊
  5 |  {}␊
  6 | 		/* */␊
  7 |␊
  8 | 	/* */␊
  9 | ;␊
`

Error 1/1

`␊
  1 | const foo = () => /* */ (␊
  2 | 	/* */␊
  3 | 	(␊
  4 | 		/* */␊
> 5 | 		undefined␊
    | 		^^^^^^^^^ Do not use useless \`undefined\`.␊
  6 | 		/* */␊
  7 | 	)␊
  8 | 	/* */␊
  9 | );␊
`

Invalid #8

  1 | foo.bind(undefined)

Output

`␊
  1 | foo.bind()␊
`

Error 1/1

`␊
> 1 | foo.bind(undefined)␊
    |          ^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #9

  1 | bind(foo, undefined)

Output

`␊
  1 | bind(foo)␊
`

Error 1/1

`␊
> 1 | bind(foo, undefined)␊
    |           ^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #10

  1 | foo.bind?.(bar, undefined)

Output

`␊
  1 | foo.bind?.(bar)␊
`

Error 1/1

`␊
> 1 | foo.bind?.(bar, undefined)␊
    |                 ^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #11

  1 | foo[bind](bar, undefined)

Output

`␊
  1 | foo[bind](bar)␊
`

Error 1/1

`␊
> 1 | foo[bind](bar, undefined)␊
    |                ^^^^^^^^^ Do not use useless \`undefined\`.␊
`

Invalid #12

  1 | foo.notBind(bar, undefined)

Output

`␊
  1 | foo.notBind(bar)␊
`

Error 1/1

`␊
> 1 | foo.notBind(bar, undefined)␊
    |                  ^^^^^^^^^ Do not use useless \`undefined\`.␊
`