I have just switched to Visual Studio Code for web development from NetBeans and am finding my way around. In NetBeans, if I forget the closing bracket on a tagname it will indicate my error with a red squiggly underline, and the alert in the left margin.
I would have thought error checking to be a fundamental function in a web development editor like Visual Studio Code. Maybe I am just not finding the right option or extension.
How can I achieve this same HTML, CSS error checking behaviour in Visual Studio Code?
Visual Studio Code doesn't have HTML validation by default. But it allows you to add extensions and enable these features.
To add HTML validation (linting), open Visual Studio Code, and then press Ctrl + P. Then paste ext install HTMLHint
in it, and press Enter. It will install an HTML validator. You may need to reload Visual Studio Code to load the extension.
Now if you open the same HTML document you had the syntax error in, you should see there's an issue shown at the status bar at the bottom :), and it will also show you the errors in those lines.