Merge "resourceloader: Configure eslint to disallow $ and require inside startup"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 12 Sep 2018 10:54:52 +0000 (10:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 12 Sep 2018 10:54:52 +0000 (10:54 +0000)
resources/src/startup/.eslintrc.json [new file with mode: 0644]
resources/src/startup/mediawiki.log.js
resources/src/startup/mediawiki.requestIdleCallback.js
resources/src/startup/profiler.js
resources/src/startup/startup.js

diff --git a/resources/src/startup/.eslintrc.json b/resources/src/startup/.eslintrc.json
new file mode 100644 (file)
index 0000000..c085e60
--- /dev/null
@@ -0,0 +1,10 @@
+{
+       "root": true,
+       "extends": "wikimedia",
+       "env": {
+               "browser": true
+       },
+       "rules": {
+               "max-len": 0
+       }
+}
index af59c7f..9283b16 100644 (file)
@@ -7,7 +7,7 @@
  * @author Trevor Parscal <tparscal@wikimedia.org>
  */
 ( function () {
-       /* global console */
+       /* global console, mw */
        /* eslint-disable no-console */
        var original = mw.log;
 
index 9f8c598..afb4737 100644 (file)
@@ -1,3 +1,4 @@
+/* global mw */
 ( function () {
        var maxBusy = 50;
 
@@ -44,7 +45,8 @@
         *  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
index 588750c..5e9b6ab 100644 (file)
@@ -4,6 +4,7 @@
  * @author Timo Tijhof
  * @since 1.32
  */
+/* global mw */
 ( function () {
        'use strict';
 
index 8e75535..5483ad2 100644 (file)
@@ -110,6 +110,7 @@ if ( !isCompatible() ) {
         * The $CODE and $VARS placeholders are substituted in ResourceLoaderStartUpModule.php.
         */
        ( function () {
+               /* global mw */
                mw.config = new mw.Map( $VARS.wgLegacyJavaScriptGlobals );
 
                $CODE.registrations();