What am I doing wrong and what do I need to do?
Try to close and re-open the VSCode again.
If the error still occurs then
You can try installing this extension the Jshint to your VS-Code.