Would help statically detect accidental use of jQuery ($) before
it is defined within startup. It would also let ESLint in my editor
catch the issue I keep running into where I use a local variable
called 'module' in mediawiki.js before it is defined, which it
doesn't detect because 'module' is whitelisted in the project's
main .eslintrc file. None of the predefined globals for regular
modules are available inside the startup module.
Follows-up
dec800968.
Bug: T192623
Change-Id: Icc102d59fff8eb7cd3f4d55f5c8b64866f2bc8af
--- /dev/null
+{
+ "root": true,
+ "extends": "wikimedia",
+ "env": {
+ "browser": true
+ },
+ "rules": {
+ "max-len": 0
+ }
+}
* @author Trevor Parscal <tparscal@wikimedia.org>
*/
( function () {
- /* global console */
+ /* global console, mw */
/* eslint-disable no-console */
var original = mw.log;
+/* global mw */
( function () {
var maxBusy = 50;
* by that time.
*/
mw.requestIdleCallback = window.requestIdleCallback ?
- window.requestIdleCallback.bind( window ) : // Bind because it throws TypeError if context is not window
+ // Bind because it throws TypeError if context is not window
+ window.requestIdleCallback.bind( window ) :
mw.requestIdleCallbackInternal;
// Note: Polyfill was previously disabled due to
// https://bugs.chromium.org/p/chromium/issues/detail?id=647870
* @author Timo Tijhof
* @since 1.32
*/
+/* global mw */
( function () {
'use strict';
* The $CODE and $VARS placeholders are substituted in ResourceLoaderStartUpModule.php.
*/
( function () {
+ /* global mw */
mw.config = new mw.Map( $VARS.wgLegacyJavaScriptGlobals );
$CODE.registrations();