Bug 1558485 - Turn on ESLint for all of dom/ disabling most of the failing rules. r=smaug
authorMark Banner <standard8@mozilla.com>
Thu, 13 Jun 2019 20:21:46 +0000
changeset 478918 b3a69dff7e25f1c1107520c238dd282405afaf92
parent 478917 e36887742fde8b0a4959f209693e5fdcbb48ebce
child 478919 14f3762c1f700dc957b4af6dc2b0740364d8d0fd
child 478927 671cd9aa9bd5bcb978b4e2b29b134b1ad905738b
push id113443
push userdvarga@mozilla.com
push dateFri, 14 Jun 2019 21:53:52 +0000
treeherdermozilla-inbound@14f3762c1f70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1558485
milestone69.0a1
first release with
nightly linux32
b3a69dff7e25 / 69.0a1 / 20190614215040 / files
nightly linux64
b3a69dff7e25 / 69.0a1 / 20190614215040 / files
nightly mac
b3a69dff7e25 / 69.0a1 / 20190614215040 / files
nightly win32
b3a69dff7e25 / 69.0a1 / 20190614215040 / files
nightly win64
b3a69dff7e25 / 69.0a1 / 20190614215040 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1558485 - Turn on ESLint for all of dom/ disabling most of the failing rules. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D34761
.eslintignore
.eslintrc.js
dom/canvas/test/test_canvas.html
dom/events/test/test_bug563329.html
dom/events/test/test_dom_activate_event.html
dom/html/test/browser_fullscreen-api-keys.js
dom/html/test/browser_fullscreen-contextmenu-esc.js
dom/html/test/browser_fullscreen-newtab.js
dom/html/test/forms/test_MozEditableElement_setUserInput.html
dom/media/tests/mochitest/test_peerConnection_stats.html
dom/media/webaudio/test/test_mixingRules.html
dom/midi/tests/test_midi_permission_allow.html
dom/midi/tests/test_midi_permission_deny.html
dom/payments/test/ConstructorChromeScript.js
dom/security/test/cors/test_CrossSiteXHR.html
dom/security/test/csp/test_child-src_iframe.html
dom/serviceworkers/test/browser_userContextId_openWindow.js
dom/serviceworkers/test/fetch_event_worker.js
dom/serviceworkers/test/test_client_focus.html
dom/tests/mochitest/fetch/common_readableStreams.js
dom/tests/mochitest/localstorage/test_bug600307-DBOps.html
dom/tests/mochitest/whatwg/test_bug500328.html
tools/rewriting/ThirdPartyPaths.txt
--- a/.eslintignore
+++ b/.eslintignore
@@ -7,62 +7,23 @@
 # Also ignore reftest - specially crafted to produce expected output.
 **/reftest/**
 **/reftests/**
 
 # Exclude expected objdirs.
 obj*/**
 
 # dom/ exclusions which should be removed (aka ESLint enabled)
-dom/animation/**
 dom/base/*.*
 dom/base/test/*.*
-dom/base/test/unit/test_serializers_entities*.js
-dom/base/test/unit_ipc/**
 dom/base/test/jsmodules/**
-dom/canvas/**
-dom/encoding/**
-dom/events/**
-dom/fetch/**
-dom/file/**
-dom/html/**
-dom/jsurl/**
 dom/media/test/**
 !dom/media/test/marionette/yttest/*.js
-dom/media/tests/**
-dom/media/webaudio/**
-dom/media/webspeech/**
-dom/messagechannel/**
-dom/midi/**
-dom/network/**
-dom/payments/**
-dom/performance/**
-dom/permission/**
 dom/promise/**
-dom/quota/**
-dom/security/test/cors/**
-dom/security/test/csp/**
-dom/security/test/general/**
-dom/security/test/mixedcontentblocker/**
-dom/security/test/sri/**
-dom/serviceworkers/**
-dom/smil/**
-dom/tests/mochitest/**
-dom/u2f/**
-dom/vr/**
-dom/webauthn/**
-dom/webgpu/**
-dom/websocket/**
-dom/workers/**
-dom/worklet/**
-dom/xbl/**
 dom/xhr/**
-dom/xml/**
-dom/xslt/**
-dom/xul/**
 
 # build/ third-party code
 build/pgo/js-input/**
 
 # browser/ exclusions
 browser/app/**
 browser/branding/**/firefox-branding.js
 # Gzipped test file.
@@ -202,16 +163,36 @@ devtools/server/tests/unit/xpcshell_debu
 # Third-party
 dom/canvas/test/webgl-conf/**
 dom/imptests/**
 dom/media/webaudio/test/blink/**
 dom/media/webvtt/**
 dom/svg/test/test_nonAnimStrings.xhtml
 dom/svg/test/test_SVG_namespace_ids.html
 
+# Strange encodings
+dom/encoding/test/test_utf16_files.html
+dom/encoding/test/file_utf16_be_bom.js
+dom/encoding/test/file_utf16_le_bom.js
+
+# Not parsable
+dom/tests/mochitest/general/test_focusrings.xul
+dom/html/test/test_bug677658.html
+
+# Intentional broken files
+dom/base/test/file_js_cache_syntax_error.js
+dom/media/tests/mochitest/identity/idp-bad.js
+dom/serviceworkers/test/file_js_cache_syntax_error.js
+dom/serviceworkers/test/parse_error_worker.js
+dom/tests/mochitest/bugs/test_bug531176.html
+dom/webauthn/tests/cbor.js
+dom/workers/test/importScripts_worker_imported3.js
+dom/workers/test/invalid.js
+dom/workers/test/threadErrors_worker1.js
+
 # Third-party
 editor/libeditor/tests/browserscope/**
 
 # Third-party
 gfx/ots/**
 gfx/skia/**
 gfx/wr/**
 
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -325,10 +325,143 @@ module.exports = {
       "rest-spread-spacing": "off",
       "semi": "off",
       "space-before-blocks": "off",
       "space-before-function-paren": "off",
       "space-infix-ops": "off",
       "space-unary-ops": "off",
       "spaced-comment": "off",
     }
+  }, {
+    "files": [
+      "dom/animation/**",
+      "dom/base/test/*.*",
+      "dom/base/test/unit/test_serializers_entities*.js",
+      "dom/base/test/unit_ipc/**",
+      "dom/base/test/jsmodules/**",
+      "dom/base/*.*",
+      "dom/canvas/**",
+      "dom/encoding/**",
+      "dom/events/**",
+      "dom/fetch/**",
+      "dom/file/**",
+      "dom/html/**",
+      "dom/jsurl/**",
+      "dom/media/tests/**",
+      "dom/media/webaudio/**",
+      "dom/media/webspeech/**",
+      "dom/messagechannel/**",
+      "dom/midi/**",
+      "dom/network/**",
+      "dom/payments/**",
+      "dom/performance/**",
+      "dom/permission/**",
+      "dom/quota/**",
+      "dom/security/test/cors/**",
+      "dom/security/test/csp/**",
+      "dom/security/test/general/**",
+      "dom/security/test/mixedcontentblocker/**",
+      "dom/security/test/sri/**",
+      "dom/serviceworkers/**",
+      "dom/smil/**",
+      "dom/tests/mochitest/**",
+      "dom/u2f/**",
+      "dom/vr/**",
+      "dom/webauthn/**",
+      "dom/webgpu/**",
+      "dom/websocket/**",
+      "dom/workers/**",
+      "dom/worklet/**",
+      "dom/xbl/**",
+      "dom/xml/**",
+      "dom/xslt/**",
+      "dom/xul/**",
+    ],
+    "rules": {
+      "consistent-return": "off",
+      "dot-notation": "off",
+      "object-shorthand": "off",
+      "mozilla/avoid-removeChild": "off",
+      "mozilla/consistent-if-bracing": "off",
+      "mozilla/no-arbitrary-setTimeout": "off",
+      "mozilla/no-compare-against-boolean-literals": "off",
+      "mozilla/no-define-cc-etc": "off",
+      "mozilla/no-useless-parameters": "off",
+      "mozilla/no-useless-run-test": "off",
+      "mozilla/reject-importGlobalProperties": "off",
+      "mozilla/use-cc-etc": "off",
+      "mozilla/use-chromeutils-generateqi": "off",
+      "mozilla/use-chromeutils-import": "off",
+      "mozilla/use-includes-instead-of-indexOf": "off",
+      "mozilla/use-ownerGlobal": "off",
+      "mozilla/use-services": "off",
+      "no-array-constructor": "off",
+      "no-caller": "off",
+      "no-cond-assign": "off",
+      "no-control-regex": "off",
+      "no-debugger": "off",
+      "no-else-return": "off",
+      "no-empty": "off",
+      "no-eval": "off",
+      "no-extra-boolean-cast": "off",
+      "no-func-assign": "off",
+      "no-global-assign": "off",
+      "no-implied-eval": "off",
+      "no-lone-blocks": "off",
+      "no-lonely-if": "off",
+      "no-nested-ternary": "off",
+      "no-new-object": "off",
+      "no-new-wrappers": "off",
+      "no-octal": "off",
+      "no-redeclare": "off",
+      "no-return-await": "off",
+      "no-restricted-globals": "off",
+      "no-self-assign": "off",
+      "no-self-compare": "off",
+      "no-sequences": "off",
+      "no-shadow": "off",
+      "no-shadow-restricted-names": "off",
+      "no-sparse-arrays": "off",
+      "no-throw-literal": "off",
+      "no-unneeded-ternary": "off",
+      "no-unreachable": "off",
+      "no-unsanitized/method": "off",
+      "no-unsanitized/property": "off",
+      "no-undef": "off",
+      "no-unused-vars": "off",
+      "no-useless-call": "off",
+      "no-useless-concat": "off",
+      "no-useless-return": "off",
+      "no-with": "off",
+
+      // Not enabling the rules below for now pending prettier roll-out.
+      "arrow-spacing": "off",
+      "block-spacing": "off",
+      "brace-style": "off",
+      "comma-dangle": "off",
+      "comma-spacing": "off",
+      "comma-style": "off",
+      "computed-property-spacing": "off",
+      "eol-last": "off",
+      "func-call-spacing": "off",
+      "generator-star-spacing": "off",
+      "linebreak-style": "off",
+      "key-spacing": "off",
+      "keyword-spacing": "off",
+      "no-extra-semi": "off",
+      "no-tabs": "off",
+      "no-mixed-spaces-and-tabs": "off",
+      "no-multi-spaces": "off",
+      "no-trailing-spaces": "off",
+      "no-unexpected-multiline": "off",
+      "no-whitespace-before-property": "off",
+      "padded-blocks": "off",
+      "quotes": "off",
+      "rest-spread-spacing": "off",
+      "semi": "off",
+      "space-before-blocks": "off",
+      "space-before-function-paren": "off",
+      "space-infix-ops": "off",
+      "space-unary-ops": "off",
+      "spaced-comment": "off",
+    }
   }]
 };
--- a/dom/canvas/test/test_canvas.html
+++ b/dom/canvas/test/test_canvas.html
@@ -11,17 +11,17 @@ const Cc = SpecialPowers.Cc;
 const Cr = SpecialPowers.Cr;
 
 function IsD2DEnabled() {
     var enabled = false;
 
     try {
         enabled = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).D2DEnabled;
     } catch(e) {}
-    
+
     return enabled;
 }
 
 function IsLinux() {
     var os = "";
 
     try {
         os = Cc["@mozilla.org/xre/app-info;1"]
@@ -29,28 +29,28 @@ function IsLinux() {
     } catch (e) {}
 
     return os.indexOf("Linux") == 0 &&
            !navigator.appVersion.includes("Android");
 }
 
 function IsAzureSkia() {
   var enabled = false;
-  
+
   try {
     var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
     enabled = (backend == "skia");
   } catch (e) { }
 
   return enabled;
 }
 
 function IsAzureCairo() {
   var enabled = false;
-  
+
   try {
     var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
     enabled = (backend == "cairo");
   } catch (e) { }
 
   return enabled;
 }
 
@@ -3634,17 +3634,17 @@ isPixel(ctx, 50,25, 0,255,0,255, 2);
 
 function test_2d_drawImage_wrongtype() {
 
 var canvas = document.getElementById('c127');
 var ctx = canvas.getContext('2d');
 
 var _thrown = undefined; try {
   ctx.drawImage(undefined, 0, 0);
-} catch (e) { _thrown = e }; 
+} catch (e) { _thrown = e };
 ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 
 var _thrown = undefined; try {
   ctx.drawImage(0, 0, 0);
 } catch (e) { _thrown = e };
 ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 
 var _thrown = undefined; try {
@@ -5886,16 +5886,17 @@ isPixel(ctx, 40,20, 0,255,0,255, 2);
 
 <!-- [[[ test_2d.gradient.linear.nonfinite.html ]]] -->
 
 <p>Canvas test: 2d.gradient.linear.nonfinite</p>
 <!-- Testing: createLinearGradient() throws NOT_SUPPORTED_ERR if arguments are not finite -->
 <canvas id="c220" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
+// eslint-disable-next-line complexity
 function test_2d_gradient_linear_nonfinite() {
 
 var canvas = document.getElementById('c220');
 var ctx = canvas.getContext('2d');
 
 var _thrown = undefined; try {
   ctx.createLinearGradient(Infinity, 0, 1, 0);
 } catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError");
@@ -6699,16 +6700,17 @@ var _thrown = undefined; try {
 
 <!-- [[[ test_2d.gradient.radial.nonfinite.html ]]] -->
 
 <p>Canvas test: 2d.gradient.radial.nonfinite</p>
 <!-- Testing: createRadialGradient() throws NOT_SUPPORTED_ERR if arguments are not finite -->
 <canvas id="c244" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
+// eslint-disable-next-line complexity
 function test_2d_gradient_radial_nonfinite() {
 
 var canvas = document.getElementById('c244');
 var ctx = canvas.getContext('2d');
 
 var _thrown = undefined; try {
   ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1);
 } catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError");
@@ -7661,16 +7663,17 @@ ok(imgdata2.data[2] === 255, "imgdata2.d
 
 <!-- [[[ test_2d.imageData.get.nonfinite.html ]]] -->
 
 <p>Canvas test: 2d.imageData.get.nonfinite</p>
 <!-- Testing: getImageData() throws NOT_SUPPORTED_ERR if arguments are not finite -->
 <canvas id="c265" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
+// eslint-disable-next-line complexity
 function test_2d_imageData_get_nonfinite() {
 
 var canvas = document.getElementById('c265');
 var ctx = canvas.getContext('2d');
 
 var _thrown = undefined; try {
   ctx.getImageData(Infinity, 10, 10, 10);
 } catch (e) { _thrown = e }; ok(_thrown && _thrown instanceof TypeError, "should throw TypeError");
@@ -8559,16 +8562,17 @@ isPixel(ctx, 75,25, 0,255,0,255, 2);
 <!-- [[[ test_2d.imageData.put.created.html ]]] -->
 
 <p>Canvas test: 2d.imageData.put.created - bug 433004</p>
 <!-- Testing: putImageData() puts image data from createImageData() onto the canvas -->
 <canvas id="c291" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
 
+// eslint-disable-next-line complexity
 function test_2d_imageData_put_created() {
 
 var canvas = document.getElementById('c291');
 var ctx = canvas.getContext('2d');
 
 var imgdata = ctx.createImageData(100, 50);
 for (var i = 0; i < imgdata.data.length; i += 4) {
     imgdata.data[i] = 0;
@@ -8848,16 +8852,17 @@ isPixel(ctx, 50,25, 0,255,0,255, 2);
 
 <!-- [[[ test_2d.imageData.put.nonfinite.html ]]] -->
 
 <p>Canvas test: 2d.imageData.put.nonfinite</p>
 <!-- Testing: putImageData() throws NOT_SUPPORTED_ERR if arguments are not finite -->
 <canvas id="c299" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
+// eslint-disable-next-line complexity
 function test_2d_imageData_put_nonfinite() {
 
 var canvas = document.getElementById('c299');
 var ctx = canvas.getContext('2d');
 
 var imgdata = ctx.getImageData(0, 0, 10, 10);
 var _thrown = undefined; try {
   ctx.putImageData(imgdata, Infinity, 10);
@@ -9231,17 +9236,17 @@ for (var i = 0; i < imgdata2.data.length
 function test_2d_imageData_put_wrongtype() {
 
 var canvas = document.getElementById('c304');
 var ctx = canvas.getContext('2d');
 
 var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] };
 var _thrown = undefined; try {
   ctx.putImageData(imgdata, 0, 0);
-} catch (e) { _thrown = e }; 
+} catch (e) { _thrown = e };
 ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 
 var _thrown = undefined; try {
   ctx.putImageData("cheese", 0, 0);
 } catch (e) { _thrown = e };
 ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
 
 var _thrown = undefined; try {
@@ -10451,16 +10456,17 @@ isPixel(ctx, 86,25, 0,255,0,255, 0);
 
 <!-- [[[ test_2d.missingargs.html ]]] -->
 
 <p>Canvas test: 2d.missingargs</p>
 <!-- Testing: Missing arguments cause NOT_SUPPORTED_ERR -->
 <canvas id="c331" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>
 
+// eslint-disable-next-line complexity
 function test_2d_missingargs() {
 
 var canvas = document.getElementById('c331');
 var ctx = canvas.getContext('2d');
 
 var _thrown = undefined; try {
   ctx.scale();
 } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "NotSupportedError" && _thrown.code == DOMException.NOT_SUPPORTED_ERR, "should throw NotSupportedError");
@@ -19477,17 +19483,17 @@ ok(ctx.createLinearGradient(0, 0, 0, 0).
   <canvas id="canvas1" width="1" height="1"></canvas>
   <canvas id="canvas2" width="1" height="1"></canvas>
   <canvas id="canvas3" width="1" height="1"></canvas>
   <img id="i1", src="image_green-1x1.png">
   <img id="i2" src="http://example.com/tests/dom/canvas/test/image_green-1x1.png">
   <img id="i3" src="image_green-redirect">
 </p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 397524 **/
 
 function draw(n) {
   $("canvas" + n).getContext('2d').drawImage($("i" + n), 0, 0);
@@ -19497,29 +19503,29 @@ function test_bug397524() {
   draw(1);
   draw(2);
   draw(3);
 
   // Should be able to get the data out of the first canvas
   $("canvas1").toDataURL("image/png");
 
   // Should not be able to get the data out of a cross-site load
-  var gotData = false;  
+  var gotData = false;
   try {
     $("canvas2").toDataURL("image/png");
     gotData = true;
   } catch (ex) {
     if (ex.code != 18 || ex.name != "SecurityError") {
       throw ex;
     }
   }
   is(gotData, false, "Shouldn't be able to read images cross-site!");
 
   // Should not be able to get the data out of a redirected cross-site load
-  var gotData = false;  
+  var gotData = false;
   try {
     $("canvas3").toDataURL("image/png");
     gotData = true;
   } catch (ex) {
     if (ex.code != 18 || ex.name != "SecurityError") {
       throw ex;
     }
   }
@@ -21155,17 +21161,17 @@ that ensues, values of alpha < 255 will 
 particular, the premultiplied color values are computed by multiplying by a,
 dividing by 255, then always rounding up.  The conversion the other way is done
 by multiplying by 255/a and rounding down.  So if
 
   255/a * (amount added when rounding) > 1
 
 we will get a change in value when we go through a putImageData/getImageData cycle.  Therefore, to make sure we don't have to worry about our color
 channels, our alpha channel should never be < 250, unless it's 0.  And when it's 0, all our color channels will come back as 0 too. */
-  
+
 /* Our tests.  Each test has two arrays: the array of values to set and the
    array of values that should read back as a result. */
 var tests = [
   [
     [ 0, 1, 3, 250 ], [ 0, 1, 3, 250 ]
   ],
   [
     [ 0, 1, 2, 250, 4, 5, 6, 250 ], [ 0, 1, 2, 250, 4, 5, 6, 250 ]
@@ -21231,17 +21237,17 @@ function doTest(type, idx) {
 function doTests(type) {
   for (var i = 0; i < tests.length; ++i) {
     doTest(type, i);
   }
 }
 
 var canvas681;
 var ctx681;
-                      
+
 function test_2d_imagedata_coercion() {
 
 canvas681 = document.getElementById('c681');
 ctx681 = canvas681.getContext('2d');
 
 doTests("fast");
 doTests("slow");
 
@@ -22332,53 +22338,54 @@ function asyncTestsDone() {
 	if (isDone_test_2d_drawImage_animated_apng &&
 		isDone_test_2d_pattern_animated_gif &&
 		isDone_test_2d_drawImage_animated_gif) {
 		SimpleTest.finish();
 	} else {
 		setTimeout(asyncTestsDone, 500);
 	}
  }
- 
+
+// eslint-disable-next-line complexity
 function runTests() {
 /**
  * xor and lighter aren't well handled by cairo; they mostly work, but we don't want
  * to test that
  */
  //test_2d_composite_solid_lighter();
  //test_2d_composite_transparent_xor();
  //test_2d_composite_solid_xor();
  //test_2d_composite_transparent_lighter();
  //test_2d_composite_image_xor();
  //test_2d_composite_image_lighter();
  //test_2d_composite_canvas_xor();
  //test_2d_composite_canvas_lighter();
  //test_2d_composite_clip_xor();
  //test_2d_composite_clip_lighter();
- 
+
 /**
  * Temporarily disabled tests; unbounded operators changed behaviour, need to reevaluate tests
  */
  //test_2d_composite_canvas_destination_atop();
  //test_2d_composite_canvas_destination_in();
  //test_2d_composite_canvas_source_in();
  //test_2d_composite_canvas_source_out();
  //test_2d_composite_image_destination_atop();
  //test_2d_composite_image_destination_in();
  //test_2d_composite_image_source_in();
  //test_2d_composite_image_source_out();
- 
+
  /**
   * These tests only pass on Mac OS X >= 10.5; see bug 450114
   */
  //test_2d_gradient_radial_equal();
  //test_2d_gradient_radial_touch1();
  //test_2d_gradient_radial_touch2();
  //test_2d_gradient_radial_touch3();
- 
+
  /**
   * These 19 tests receive special makefile treatment
   */
  //test_2d_composite_uncovered_image_destination_atop();
  //test_2d_composite_uncovered_image_destination_in();
  //test_2d_composite_uncovered_image_source_in();
  //test_2d_composite_uncovered_image_source_out();
  //test_2d_gradient_radial_cone_behind();
@@ -22391,32 +22398,32 @@ function runTests() {
  //test_2d_gradient_radial_outside1();
  //test_2d_gradient_radial_outside2();
  //test_2d_gradient_radial_outside3();
  //test_2d_line_cap_closed();
  //test_2d_line_join_parallel();
  //test_2d_path_arc_shape_3();
  //test_2d_path_rect_selfintersect();
  //test_2d_strokeRect_zero_5();
- 
+
  /**
   * Other tests not being run
   */
  //test_2d_composite_uncovered_fill_destination_atop();
  //test_2d_composite_uncovered_fill_destination_in();
  //test_2d_composite_uncovered_fill_source_in();
  //test_2d_composite_uncovered_fill_source_out();
  //test_2d_composite_uncovered_pattern_destination_atop();
  //test_2d_composite_uncovered_pattern_destination_in();
  //test_2d_composite_uncovered_pattern_source_in();
  //test_2d_composite_uncovered_pattern_source_out();
- 
+
  //test_2d_path_rect_zero_6();	// This test is bogus according to the spec; see bug 407107
 
- // These tests are bogus according to the spec: shadows should not be 
+ // These tests are bogus according to the spec: shadows should not be
  // drawn if shadowBlur, shadowOffsetX, and shadowOffsetY are all zero, whic
  // they are in these tests
  //test_2d_shadow_composite_3();
  //test_2d_shadow_composite_4();
  try {
   test_2d_canvas_readonly();
  } catch (e) {
   ok(false, "unexpected exception thrown in: test_2d_canvas_readonly");
@@ -25767,15 +25774,15 @@ function runTests() {
  } catch (e) {
   ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_apng");
  }
  try {
   test_2d_drawImage_animated_gif();
  } catch (e) {
   ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_gif");
  }
- 
+
  setTimeout(asyncTestsDone, 500);
 }
 
 addLoadEvent(runTests);
 
 </script>
--- a/dom/events/test/test_bug563329.html
+++ b/dom/events/test/test_bug563329.html
@@ -8,29 +8,29 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script src="/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=563329">Mozilla Bug 563329</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 563329 **/
 /*  ui.click_hold_context_menus preference */
 
 var target = null;
 var testGen = getTests();
 var currentTest = null;
 
-function getTests() {
+function* getTests() {
   let tests = [
     { "func": function() { setTimeout(doCheckContextMenu, 100)}, "message": "Context menu should has fired"},
     { "func": function() { setTimeout(doCheckDuration, 100)}, "message": "Context menu should has fired with delay"},
     { "func": function() { setTimeout(finishTest, 100)}, "message": "" }
   ];
 
   let i = 0;
   while (i < tests.length)
--- a/dom/events/test/test_dom_activate_event.html
+++ b/dom/events/test/test_dom_activate_event.html
@@ -12,21 +12,23 @@
 <button id="button">button</button>
 <input id="checkbox" type="checkbox">
 <input id="radio" type="radio">
 <input id="submit" type="submit">
 <input id="ibutton" type="button">
 <input id="reset" type="reset">
 </p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script type="application/javascript">
 
+/* eslint-disable max-nested-callbacks */
+
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(runTests);
 
 function runIsTrustedTestCausedByTrustedClick(aElement, aNextTest)
 {
   const kDescription = "runIsTrustedTestCausedByTrustedClick(aElement.id=" + aElement.id + "): ";
   var DOMActivateFired = false;
   aElement.addEventListener("DOMActivate", function (aEvent) {
--- a/dom/html/test/browser_fullscreen-api-keys.js
+++ b/dom/html/test/browser_fullscreen-api-keys.js
@@ -12,16 +12,17 @@ SimpleTest.ignoreAllUncaughtExceptions(t
 const kKeyList = [
   { key: "Escape", keyCode: "VK_ESCAPE", suppressed: true},
   { key: "F11",    keyCode: "VK_F11",    suppressed: false},
 ];
 
 const kStrictKeyPressEvents =
   SpecialPowers.getBoolPref("dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content");
 
+/* eslint-disable mozilla/no-arbitrary-setTimeout */
 function frameScript() {
   let doc = content.document;
   addMessageListener("Test:RequestFullscreen", () => {
     doc.body.requestFullscreen();
   });
   addMessageListener("Test:DispatchUntrustedKeyEvents", msg => {
     var evt = new content.CustomEvent("Test:DispatchKeyEvents", {
       detail: Cu.cloneInto({ code: msg.data }, content),
@@ -47,16 +48,17 @@ function frameScript() {
     if (docShell.isActive && doc.hasFocus()) {
       sendAsyncMessage("Test:Activated");
     } else {
       setTimeout(waitUntilActive, 10);
     }
   }
   waitUntilActive();
 }
+/* eslint-enable mozilla/no-arbitrary-setTimeout */
 
 var gMessageManager;
 
 function listenOneMessage(aMsg, aListener) {
   function listener({ data }) {
     gMessageManager.removeMessageListener(aMsg, listener);
     aListener(data);
   }
--- a/dom/html/test/browser_fullscreen-contextmenu-esc.js
+++ b/dom/html/test/browser_fullscreen-contextmenu-esc.js
@@ -1,16 +1,17 @@
 "use strict";
 
 // This test tends to trigger a race in the fullscreen time telemetry,
 // where the fullscreen enter and fullscreen exit events (which use the
 // same histogram ID) overlap. That causes TelemetryStopwatch to log an
 // error.
 SimpleTest.ignoreAllUncaughtExceptions(true);
 
+/* eslint-disable mozilla/no-arbitrary-setTimeout */
 function frameScript() {
   addMessageListener("Test:RequestFullscreen", () => {
     content.document.body.requestFullscreen();
   });
   content.document.addEventListener("fullscreenchange", () => {
     sendAsyncMessage("Test:FullscreenChanged",
                      !!content.document.fullscreenElement);
   });
@@ -22,16 +23,17 @@ function frameScript() {
     if (docShell.isActive && content.document.hasFocus()) {
       sendAsyncMessage("Test:Activated");
     } else {
       setTimeout(waitUntilActive, 10);
     }
   }
   waitUntilActive();
 }
+/* eslint-enable mozilla/no-arbitrary-setTimeout */
 
 var gMessageManager;
 
 function listenOneMessage(aMsg, aListener) {
   function listener({ data }) {
     gMessageManager.removeMessageListener(aMsg, listener);
     aListener(data);
   }
@@ -90,16 +92,17 @@ add_task(async function() {
   info("Send the first escape");
   let popupHidePromise = promiseWaitForEvent(window, "popuphidden");
   EventUtils.synthesizeKey("KEY_Escape");
   await popupHidePromise;
   is(contextMenu.state, "closed", "Should have closed context menu");
 
   // Wait a small time to confirm that the first ESC key
   // does not exit fullscreen.
+  // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 1000));
   gMessageManager.sendAsyncMessage("Test:QueryFullscreenState");
   state = await promiseOneMessage("Test:FullscreenState");
   ok(state, "The content should still be in fullscreen");
   ok(document.fullscreenElement, "The chrome should still be in fullscreen");
 
   info("Send the second escape");
   gMessageManager.removeMessageListener(
--- a/dom/html/test/browser_fullscreen-newtab.js
+++ b/dom/html/test/browser_fullscreen-newtab.js
@@ -56,16 +56,17 @@ async function runTest() {
       BrowserTestUtils.waitForNewTab(gBrowser, "about:blank");
     await BrowserTestUtils.synthesizeMouseAtCenter("#link", {}, browser);
     let [newtab] = await Promise.all([promiseNewTab, promiseFsEvents]);
     await BrowserTestUtils.removeTab(newtab);
 
     // Ensure the browser exits fullscreen state in reasonable time.
     await Promise.race([
       BrowserTestUtils.waitForCondition(() => getSizeMode() == "normal"),
+      // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
       new Promise(resolve => setTimeout(resolve, 2000))
     ]);
 
     ok(!window.fullScreen, "The chrome window should not be in fullscreen");
     ok(!document.fullscreen, "The chrome document should not be in fullscreen");
   });
 }
 
--- a/dom/html/test/forms/test_MozEditableElement_setUserInput.html
+++ b/dom/html/test/forms/test_MozEditableElement_setUserInput.html
@@ -9,16 +9,17 @@
 <div id="display">
 </div>
 <div id="content"></div>
 <pre id="test">
 </pre>
 
 <script class="testbody" type="application/javascript">
 SimpleTest.waitForExplicitFinish();
+// eslint-disable-next-line complexity
 SimpleTest.waitForFocus(() => {
   let content = document.getElementById("content");
   /**
    * Test structure:
    *   element: the tag name to create.
    *   type: the type attribute value for the element.  If unnecessary omit it.
    *   input: the values calling setUserInput() with.
    *     before: used when calling setUserInput() before the element gets focus.
--- a/dom/media/tests/mochitest/test_peerConnection_stats.html
+++ b/dom/media/tests/mochitest/test_peerConnection_stats.html
@@ -310,16 +310,17 @@ var checkExpectedFields = report => repo
   });
 });
 
 var pedanticChecks = report => {
   // Check that report is only-maplike
   [...report.keys()].forEach(key => is(report[key], undefined,
       `Report is not dictionary like, it lacks a property for key ${key}`));
 
+  // eslint-disable-next-line complexity
   report.forEach((statObj, mapKey) => {
     let tested = {};
     // Record what fields get tested.
     // To access a field foo without marking it as tested use stat.inner.foo
     let stat = new Proxy(statObj, {
       get(stat, key) {
         if (key == "inner") return stat;
         tested[key] = true;
--- a/dom/media/webaudio/test/test_mixingRules.html
+++ b/dom/media/webaudio/test/test_mixingRules.html
@@ -97,16 +97,17 @@ function discreteSum(sourceBuffer, destB
         for (var i = 0; i < length; ++i) {
             dest[i] += source[i];
         }
     }
 }
 
 // Speaker channel interpretation mixing:
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#UpMix
+// eslint-disable-next-line complexity
 function speakersSum(sourceBuffer, destBuffer)
 {
     var numberOfSourceChannels = sourceBuffer.numberOfChannels;
     var numberOfDestinationChannels = destBuffer.numberOfChannels;
     var length = destBuffer.length;
 
     if ((numberOfDestinationChannels == 2 && numberOfSourceChannels == 1) ||
         (numberOfDestinationChannels == 4 && numberOfSourceChannels == 1)) {
--- a/dom/midi/tests/test_midi_permission_allow.html
+++ b/dom/midi/tests/test_midi_permission_allow.html
@@ -11,16 +11,16 @@
 
      async function runTests() {
        await MIDITestUtils.permissionSetup(true);
        // Request access without sysex.
        try {
          await navigator.requestMIDIAccess({ "sysex": false })
          ok(true, "MIDI Access Request successful");
          SimpleTest.finish();
-       } catch {
+       } catch (ex) {
          ok(false, "MIDI Access Request Failed!");
          SimpleTest.finish();
        }
      }
     </script>
   </body>
 </html>
--- a/dom/midi/tests/test_midi_permission_deny.html
+++ b/dom/midi/tests/test_midi_permission_deny.html
@@ -11,16 +11,16 @@
 
      async function runTests() {
        await MIDITestUtils.permissionSetup(false);
        // Request access without sysex.
        try {
          await navigator.requestMIDIAccess({ "sysex": false });
          ok(false, "MIDI Access Request Deny failed");
          SimpleTest.finish();
-       } catch {
+       } catch (ex) {
          ok(true, "MIDI Access Request Deny successful!");
          SimpleTest.finish();
        }
      }
     </script>
   </body>
 </html>
--- a/dom/payments/test/ConstructorChromeScript.js
+++ b/dom/payments/test/ConstructorChromeScript.js
@@ -69,16 +69,17 @@ function checkSimplestRequest(payRequest
   if (paymentOptions.requestShipping) {
     emitTestFail("requestShipping option should be false.");
   }
   if (paymentOptions.shippingType != "shipping") {
     emitTestFail("shippingType option should be 'shipping'.")
   }
 }
 
+// eslint-disable-next-line complexity
 function checkComplexRequest(payRequest) {
   if (payRequest.topLevelPrincipal.origin != "https://example.com") {
     emitTestFail("Top level principal's origin should be 'https://example.com', but got '"
                  + payRequest.topLevelPrincipal.origin + "'.");
   }
 
   if (payRequest.paymentMethods.length != 1) {
     emitTestFail("paymentMethods' length should be 1.");
--- a/dom/security/test/cors/test_CrossSiteXHR.html
+++ b/dom/security/test/cors/test_CrossSiteXHR.html
@@ -1,22 +1,22 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
   <title>Test for Cross Site XMLHttpRequest</title>
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>        
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="initTest()">
 <p id="display">
 <iframe id=loader></iframe>
 </p>
 <div id="content" style="display: none">
-  
+
 </div>
 <pre id="test">
 <script class="testbody" type="application/javascript">
 
 const runPreflightTests = 1;
 const runCookieTests = 1;
 const runRedirectTests = 1;
 
@@ -31,20 +31,21 @@ function initTest() {
 }
 
 function initTestCallback() {
   window.addEventListener("message", function(e) {
     gen.next(e.data);
   });
 
   gen = runTest();
-  
+
   gen.next()
 }
 
+// eslint-disable-next-line complexity
 function* runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   // Test preflight-less requests
   basePath = "/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?"
   baseURL = "http://mochi.test:8888" + basePath;
--- a/dom/security/test/csp/test_child-src_iframe.html
+++ b/dom/security/test/csp/test_child-src_iframe.html
@@ -57,17 +57,16 @@ var tests = {
   'other-src-by-frame-src': {
     id: "other-src-by-frame-src",
     file: IFRAME_SRC,
     result : "blocked",
     policy : "default-src 'none'; script-src 'unsafe-inline'; child-src http://mochi.test:8888; frame-src http://www.example.com"
   },
   'none-src-by-frame-src': {
     id: "none-src-by-frame-src",
-    file: "file_child-src_iframe.html",
     file: IFRAME_SRC,
     result : "blocked",
     policy : "default-src 'none'; script-src 'unsafe-inline'; child-src http://mochi.test:8888; frame-src 'none'"
   }
 };
 
 finished = {};
 
--- a/dom/serviceworkers/test/browser_userContextId_openWindow.js
+++ b/dom/serviceworkers/test/browser_userContextId_openWindow.js
@@ -6,19 +6,21 @@ let swm = Cc["@mozilla.org/serviceworker
 const URI = "https://example.com/browser/dom/serviceworkers/test/empty.html";
 const MOCK_CID = Components.ID("{2a0f83c4-8818-4914-a184-f1172b4eaaa7}");
 const ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/alerts-service;1";
 const USER_CONTEXT_ID = 3
 
 let mockAlertsService = {
   showAlert: function(alert, alertListener) {
     ok(true, "Showing alert");
+    // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
     setTimeout(function () {
       alertListener.observe(null, "alertshow", alert.cookie);
     }, 100);
+    // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
     setTimeout(function () {
       alertListener.observe(null, "alertclickcallback", alert.cookie);
     }, 100);
   },
 
   showAlertNotification: function(imageUrl, title, text, textClickable,
                                   cookie, alertListener, name, dir, lang, data) {
     this.showAlert();
--- a/dom/serviceworkers/test/fetch_event_worker.js
+++ b/dom/serviceworkers/test/fetch_event_worker.js
@@ -1,10 +1,11 @@
 var seenIndex = false;
 
+// eslint-disable-next-line complexity
 onfetch = function(ev) {
   if (ev.request.url.includes("ignore")) {
     return;
   }
 
   if (ev.request.url.includes("bare-synthesized.txt")) {
     ev.respondWith(Promise.resolve(
       new Response("synthesized response body", {})
--- a/dom/serviceworkers/test/test_client_focus.html
+++ b/dom/serviceworkers/test/test_client_focus.html
@@ -22,17 +22,17 @@
   var registration;
   var worker;
 
   function start() {
     return navigator.serviceWorker.register("client_focus_worker.js",
                                             { scope: "./sw_clients/focus_stealing_client.html" })
       .then((swr) => {
         registration = swr;
-        returun waitForState(swr.installing, 'activated', swr);
+        return waitForState(swr.installing, 'activated', swr);
       });
   }
 
   function unregister() {
     return registration.unregister().then(function(result) {
       ok(result, "Unregister should return true.");
     }, function(e) {
       dump("Unregistering the SW failed with " + e + "\n");
@@ -92,9 +92,8 @@
     ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     ["dom.serviceWorkers.enabled", true],
     ["dom.serviceWorkers.testing.enabled", true],
   ]}, runTest);
 </script>
 </pre>
 </body>
 </html>
-
--- a/dom/tests/mochitest/fetch/common_readableStreams.js
+++ b/dom/tests/mochitest/fetch/common_readableStreams.js
@@ -137,17 +137,17 @@ async function test_noUint8Array(compart
 }
 
 async function test_noUint8Array_continue(r, that) {
   that.ok(r.body instanceof that.ReadableStream, "We have a ReadableStream");
 
   try {
     await r.blob();
     that.ok(false, "We cannot have a blob here!");
-  } catch {
+  } catch (ex) {
     that.ok(true, "We cannot have a blob here!");
   }
 }
 
 async function test_pendingStream(compartment) {
   let r = new Response(new ReadableStream({start : controller => {
     controller.enqueue(makeBuffer(BIG_BUFFER_SIZE));
     // Let's keep this controler open.
--- a/dom/tests/mochitest/localstorage/test_bug600307-DBOps.html
+++ b/dom/tests/mochitest/localstorage/test_bug600307-DBOps.html
@@ -3,16 +3,18 @@
 <title>bug 600307</title>
 
 <script src="/tests/SimpleTest/SimpleTest.js"></script>
 <script type="text/javascript" src="localStorageCommon.js"></script>
 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <script type="text/javascript">
 
+/* eslint-disable max-nested-callbacks */
+
 /*
 This is strictly implementation specific test for dom storage code from bug 600307.
 It exercises code for asynchronous data flushing with regard to cache life time and its preload.
 
 "flush + reload" means to tell the database to store all pending data then wipe the cached content and reload it from the db
 
 "reload" only means to simulate situation when there is a pending flush for an origin but a new cache is about to preload
 which is a corner case happening rarely ; this helps check the next preload operation will load correct data from the database anyway
--- a/dom/tests/mochitest/whatwg/test_bug500328.html
+++ b/dom/tests/mochitest/whatwg/test_bug500328.html
@@ -192,17 +192,17 @@ function expectException(func, msg) {
     func();
   } catch(ex) {
     failed = true;
   }
 
   ok(failed, msg + " succeeded, but should have failed.");
 }
 
-function runTest() {
+function* runTest() {
   // We can't enable universal XPConnect privleges in this function, because
   // test 5 needs to be running at normal privleges in order to test the
   // same-origin policy.
 
   /**
    * PRELIMINARY:
    *  1. Clear the popstate counter
    */
@@ -526,17 +526,17 @@ function runTest() {
   enableChildLoadCallback();
   yield undefined;
   statusMsg("Awake after loading content into popup.");
 
   popup.history.replaceState({n:1, ok:true}, "state 1", "good1.html");
   locationEndsWith(popup, "good1.html");
 
   // Even though we replaceState with title "state 1", the title should remain
-  // "test 1" because we ignore the title argument in push/replaceState.  
+  // "test 1" because we ignore the title argument in push/replaceState.
   // See bug 544535.
   is(getSHTitle(shistory), "test 1", "SHEntry title 'state 1'");
 
   // Flush the event loop so our next load creates a new session history entry.
   shortWait();
   yield undefined;
 
   enableChildLoadCallback();
--- a/tools/rewriting/ThirdPartyPaths.txt
+++ b/tools/rewriting/ThirdPartyPaths.txt
@@ -19,17 +19,25 @@ dom/media/platforms/ffmpeg/libav53/
 dom/media/platforms/ffmpeg/libav54/
 dom/media/platforms/ffmpeg/libav55/
 dom/media/webspeech/recognition/endpointer.cc
 dom/media/webspeech/recognition/endpointer.h
 dom/media/webspeech/recognition/energy_endpointer.cc
 dom/media/webspeech/recognition/energy_endpointer.h
 dom/media/webspeech/recognition/energy_endpointer_params.cc
 dom/media/webspeech/recognition/energy_endpointer_params.h
+dom/tests/ajax/jquery/
+dom/tests/ajax/mochikit/
+dom/tests/mochitest/ajax/
+dom/tests/mochitest/dom-level1-core/
+dom/tests/mochitest/dom-level2-core/
+dom/tests/mochitest/dom-level2-html/
+dom/u2f/tests/pkijs/
 dom/webauthn/cbor-cpp/
+dom/webauthn/tests/pkijs/
 editor/libeditor/tests/browserscope/lib/richtext/
 editor/libeditor/tests/browserscope/lib/richtext2/
 extensions/spellcheck/hunspell/src/
 gfx/angle/
 gfx/cairo/
 gfx/graphite2/
 gfx/harfbuzz/
 gfx/ots/