081580bcd8
There were a few undefined variables being referenced within the Select2 code. The JSHint configuration has been modified to fail if there are undefined variables being referenced, including any global variables. There is an exception that is being made for the jQuery shim, as it must try to find the global jQuery references. An exception is made for the test helpers, as the SauceLabs reporting variables are not camelCase, and would normally trigger warnings. This closes https://github.com/select2/select2/pull/3028.
15 lines
357 B
JavaScript
15 lines
357 B
JavaScript
/* global jQuery:false, $:false */
|
|
define(function () {
|
|
var _$ = jQuery || $;
|
|
|
|
if (_$ == null && console && console.error) {
|
|
console.error(
|
|
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
|
|
'found. Make sure that you are including jQuery before Select2 on your ' +
|
|
'web page.'
|
|
);
|
|
}
|
|
|
|
return _$;
|
|
});
|