Why does my code lint the one of identical code lines:

enter image description hereThe code on line 6 is identical to line 5. But the same code on line 6 doesnt cause any lint errors. Details of the errors have been highlighted in the image attached.

I was expect the first line be syntactically correct and not have any lint errors. But pasting the same code from an external source to vscode on the second line didnt cause any lint errors. But both code do the same thing and are exact. So why does line 5 show lint errors and why does the same code on line 6 pass without any lint errors.