Help files worldwide in VS Code (JS)

I have a website where I use Grunt to concat files. I am wondering if there is any way to reference my Bower packages in all my JS files, as I use these packages in my files.

Example: I include the “moment” as a Bower package, and then when I reference the “moment” in my JS file in VS code. I get a warning that the “moment” does not exist. This is annoying because I know that it exists globally and would like to be able to manually reference its code completion (and get rid of the warning).

+5
source share
1 answer

You can omit the warning by adding the following to the beginning of your sources:

/*global moment*/ 

You can also create the globals.js file, add all these global definitions to it, and refer to it from your sources as follows:

 /// <reference path="global.js" /> 
+2
source

All Articles