Katana314
Katana314

Reputation: 8620

Why is/was JavaScript checking in HTML in VS Code gone circa March 2016?

Take the following sample of HTML.

<html>
<head>
<script>

  var myArr = ['thing1' thing2'];

</script>
</head>
<body>
</body>
</html>

If you're perceptive, you'll notice that I forgot to put a comma between the two array values inside of the script. This will, of course, cause any browser to fail to parse it and the whole script tag will not run. In previous versions of Code, this would be noted with a red underline, but it seems like in recent versions support has moved to plugins. They recommend installing the JSHint plugin to catch some issues, but I have a .jshintrc file in my project directory, with very few entries (to try to use mostly defaults) and while it catches "recommendations", it's still not catching actual syntax issues that break the scripts entirely. I'm also not sure it's doing anything for JavaScript it sees inside of a <script> tag (which I currently use to do quick tests or examples of features). It highlights keywords, but doesn't check syntax or anything.

Is there any configuration I can apply to Code, or my project, to get back this behavior?

Upvotes: 2

Views: 2478

Answers (1)

Brett
Brett

Reputation: 4269

The catching of actual syntax issues has been delegated to the Salsa interpreter within Visual Studio. Maybe this is a bug? However, for the other point you made about quick-checking code within script tags, as of the v0.10.10 Feb 2016 release notes:

There is no longer support for IntelliSense in script sections inside HTML documents.

Upvotes: 1

Related Questions