The actual snapshot is saved in no-useless-undefined.mjs.snap
.
Generated by AVA.
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 | )␊
`
1 | function foo([bar = undefined] = []) {}
Output
`␊
1 | function foo([bar] = []) {}␊
`
Error 1/1
`␊
> 1 | function foo([bar = undefined] = []) {}␊
| ^^^^^^^^^ Do not use useless \`undefined\`.␊
`
1 | foo(bar, undefined, undefined);
Output
`␊
1 | foo(bar);␊
`
Error 1/1
`␊
> 1 | foo(bar, undefined, undefined);␊
| ^^^^^^^^^^^^^^^^^^^^ Do not use useless \`undefined\`.␊
`
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\`.␊
`
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 | }␊
`
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 | }␊
`
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 | );␊
`
1 | foo.bind(undefined)
Output
`␊
1 | foo.bind()␊
`
Error 1/1
`␊
> 1 | foo.bind(undefined)␊
| ^^^^^^^^^ Do not use useless \`undefined\`.␊
`
1 | bind(foo, undefined)
Output
`␊
1 | bind(foo)␊
`
Error 1/1
`␊
> 1 | bind(foo, undefined)␊
| ^^^^^^^^^ Do not use useless \`undefined\`.␊
`
1 | foo.bind?.(bar, undefined)
Output
`␊
1 | foo.bind?.(bar)␊
`
Error 1/1
`␊
> 1 | foo.bind?.(bar, undefined)␊
| ^^^^^^^^^ Do not use useless \`undefined\`.␊
`
1 | foo[bind](bar, undefined)
Output
`␊
1 | foo[bind](bar)␊
`
Error 1/1
`␊
> 1 | foo[bind](bar, undefined)␊
| ^^^^^^^^^ Do not use useless \`undefined\`.␊
`
1 | foo.notBind(bar, undefined)
Output
`␊
1 | foo.notBind(bar)␊
`
Error 1/1
`␊
> 1 | foo.notBind(bar, undefined)␊
| ^^^^^^^^^ Do not use useless \`undefined\`.␊
`