Problem/Motivation

JavaScript code must be consistent and free from syntax error and leaking variables and that it can be properly minified.

Proposed resolution

Detect errors and potential problems in JavaScript code with ESLint and fix them.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 eslint-monitoring.patch1.95 KBCTaPByK

Comments

CTaPByK created an issue. See original summary.

CTaPByK’s picture

Status: Needs review » Needs work

The last submitted patch, 2: eslint-monitoring.patch, failed testing.

mbovan’s picture

Status: Needs work » Reviewed & tested by the community

I don't find anything problematic here.

Christopher Riley’s picture

Just tried to apply this patch and it failed with the following:

monitoring.js.rej

--- monitoring.js
+++ monitoring.js
@@ -18,7 +19,7 @@
             .appendTo('.monitoring-overview-summary', context)
             .click(
               function () {
-                if ($(this).text() == Drupal.t('Show OK sensors')) {
+                if ($(this).text() === Drupal.t('Show OK sensors')) {
                   $(this).text(Drupal.t('Hide OK sensors'));
                   $('#monitoring-sensors-overview tr.monitoring-ok, #monitoring-sensors-overview tr.sensor-category-ok', context).fadeIn();
                 }
@@ -32,7 +33,7 @@
         $('#monitoring-sensors-overview tr.monitoring-ok, #monitoring-sensors-overview tr.sensor-category-ok', context).hide();
       }
     }
-  }
+  };

 })(jQuery);