My situation involves a userscript that utilizes the @require directive in the metadata block to load jQuery from an external source:
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
It seems like WebStorm isn't aware of userscripts, which causes it to not recognize that variables such as $
will be defined by the time they are used in my code.
Is there a way to make WebStorm treat my file as if it has directly included the contents of jquery.min.js
at the beginning, so that I stop receiving warnings about undefined variables like $
? For example, could I place a local copy of jquery.min.js
in a designated folder and instruct WebStorm to consider all declarations from that file?