Found the solution. And it’s rather simple. Thanks to this site, found the solution that fixed my problem. Gereon too has mentioned it rightly in his comment.
Turns out I had somehow disabled the extension in VSCode. All I had to do was enable it. There’s an icon at the bottom right corner that says ESLint, and if disabled, it’s shown with a red icon. All that I had to do was click on it, and allow it to be enabled everywhere in the dialog that was shown soon after.
