@@ -3897,6 +3897,154 @@ Generated by [AVA](https://avajs.dev).
38973897 `
38983898
38993899## Invalid #216
3900+ 1 | const a = () => (( foo.forEach(element => bar(element)) ))
3901+
3902+ > Output
3903+
3904+ `␊
3905+ 1 | const a = () => { for (const element of foo) bar(element) } ␊
3906+ `
3907+
3908+ > Error 1/1
3909+
3910+ `␊
3911+ > 1 | const a = () => (( foo.forEach(element => bar(element)) ))␊
3912+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
3913+ `
3914+
3915+ ## Invalid #217
3916+ 1 | const a = () => (( foo?.forEach(element => bar(element)) ))
3917+
3918+ > Output
3919+
3920+ `␊
3921+ 1 | const a = () => { if (foo) for (const element of foo) bar(element) } ␊
3922+ `
3923+
3924+ > Error 1/1
3925+
3926+ `␊
3927+ > 1 | const a = () => (( foo?.forEach(element => bar(element)) ))␊
3928+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
3929+ `
3930+
3931+ ## Invalid #218
3932+ 1 | const a = () => (( foo.forEach(element => bar(element)) ));
3933+
3934+ > Output
3935+
3936+ `␊
3937+ 1 | const a = () => { for (const element of foo) bar(element) } ;␊
3938+ `
3939+
3940+ > Error 1/1
3941+
3942+ `␊
3943+ > 1 | const a = () => (( foo.forEach(element => bar(element)) ));␊
3944+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
3945+ `
3946+
3947+ ## Invalid #219
3948+ 1 | const a = () => (( foo?.forEach(element => bar(element)) ));
3949+
3950+ > Output
3951+
3952+ `␊
3953+ 1 | const a = () => { if (foo) for (const element of foo) bar(element) } ;␊
3954+ `
3955+
3956+ > Error 1/1
3957+
3958+ `␊
3959+ > 1 | const a = () => (( foo?.forEach(element => bar(element)) ));␊
3960+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
3961+ `
3962+
3963+ ## Invalid #220
3964+ 1 | const a = () => foo.forEach(element => bar(element))
3965+
3966+ > Output
3967+
3968+ `␊
3969+ 1 | const a = () => { for (const element of foo) bar(element) }␊
3970+ `
3971+
3972+ > Error 1/1
3973+
3974+ `␊
3975+ > 1 | const a = () => foo.forEach(element => bar(element))␊
3976+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
3977+ `
3978+
3979+ ## Invalid #221
3980+ 1 | const a = () => foo?.forEach(element => bar(element))
3981+
3982+ > Output
3983+
3984+ `␊
3985+ 1 | const a = () => { if (foo) for (const element of foo) bar(element) }␊
3986+ `
3987+
3988+ > Error 1/1
3989+
3990+ `␊
3991+ > 1 | const a = () => foo?.forEach(element => bar(element))␊
3992+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
3993+ `
3994+
3995+ ## Invalid #222
3996+ 1 | const a = () => foo.forEach(element => bar(element));
3997+
3998+ > Output
3999+
4000+ `␊
4001+ 1 | const a = () => { for (const element of foo) bar(element) };␊
4002+ `
4003+
4004+ > Error 1/1
4005+
4006+ `␊
4007+ > 1 | const a = () => foo.forEach(element => bar(element));␊
4008+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4009+ `
4010+
4011+ ## Invalid #223
4012+ 1 | const a = () => foo?.forEach(element => bar(element));
4013+
4014+ > Output
4015+
4016+ `␊
4017+ 1 | const a = () => { if (foo) for (const element of foo) bar(element) };␊
4018+ `
4019+
4020+ > Error 1/1
4021+
4022+ `␊
4023+ > 1 | const a = () => foo?.forEach(element => bar(element));␊
4024+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4025+ `
4026+
4027+ ## Invalid #224
4028+ 1 | const a = () => void foo.forEach(element => bar(element));
4029+
4030+ > Error 1/1
4031+
4032+ `␊
4033+ > 1 | const a = () => void foo.forEach(element => bar(element));␊
4034+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4035+ `
4036+
4037+ ## Invalid #225
4038+ 1 | const a = () => void foo?.forEach(element => bar(element));
4039+
4040+ > Error 1/1
4041+
4042+ `␊
4043+ > 1 | const a = () => void foo?.forEach(element => bar(element));␊
4044+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4045+ `
4046+
4047+ ## Invalid #226
39004048 1 | 1?.forEach((a, b) => call(a, b))
39014049
39024050> Output
@@ -3911,3 +4059,49 @@ Generated by [AVA](https://avajs.dev).
39114059 > 1 | 1?.forEach((a, b) => call(a, b))␊
39124060 | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
39134061 `
4062+
4063+ ## Invalid #227
4064+ 1 | array.forEach((arrayInArray) => arrayInArray.forEach(element => bar(element)));
4065+
4066+ > Output
4067+
4068+ `␊
4069+ 1 | for (const arrayInArray of array) for (const element of arrayInArray) bar(element);␊
4070+ `
4071+
4072+ > Error 1/2
4073+
4074+ `␊
4075+ > 1 | array.forEach((arrayInArray) => arrayInArray.forEach(element => bar(element)));␊
4076+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4077+ `
4078+
4079+ > Error 2/2
4080+
4081+ `␊
4082+ > 1 | array.forEach((arrayInArray) => arrayInArray.forEach(element => bar(element)));␊
4083+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4084+ `
4085+
4086+ ## Invalid #228
4087+ 1 | array.forEach((arrayInArray) => arrayInArray?.forEach(element => bar(element)));
4088+
4089+ > Output
4090+
4091+ `␊
4092+ 1 | for (const arrayInArray of array) if (arrayInArray) for (const element of arrayInArray) bar(element);␊
4093+ `
4094+
4095+ > Error 1/2
4096+
4097+ `␊
4098+ > 1 | array.forEach((arrayInArray) => arrayInArray?.forEach(element => bar(element)));␊
4099+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4100+ `
4101+
4102+ > Error 2/2
4103+
4104+ `␊
4105+ > 1 | array.forEach((arrayInArray) => arrayInArray?.forEach(element => bar(element)));␊
4106+ | ^^^^^^^ Use \`for…of\` instead of \`.forEach(…)\`.␊
4107+ `
0 commit comments