VScode detects file as JavaScript, but doesn't highlight undefined functions

Viewed 672

The following JavaScript is saved into a file called test.js

iDontExist();

(this is the entire file)

VSCode doesn't show the highlights for the iDontExist function, which isn't imported or required anywhere.

How can I make VScode highlight the undefined function?

enter image description here

Note other Intellisense features (eg, inspecting imports) in JS files (not TS files) seem to work fine:

enter image description here

1 Answers

Undefined functions in VSCode aren't automatically highlighted when they are undefined because of globals, this includes a totally different setup to get the highlighting running:

Using the ESlint Extension to get undefined functions or errors highlighted.

enter image description here

You can also use ts-check, which is what I use and has been working fine.

Related