Thread:Manual talk:Coding conventions/JavaScript/Globals on gadgets and user scripts/reply

These conventions are written for development of JavaScript files as part of the MediaWiki core software package. During code review, we apply these conventions and could even reject a change if it doesn't comply (in theory).

For user scripts, however, there are no official conventions (and there can't be, because they are your own), you decide what and how you put something there. Nobody can reject your edit to a gadget in that sense.

But as far as recommendation goes, Yes, please, I recommend you use these conventions in your user scripts and gadgets as well. Including the section regarding "Globals".