diff --git a/.eslintignore b/.eslintignore index d59d3debf0eb..e3db34109bfb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -14,7 +14,6 @@ obj*/** # We ignore all these directories by default, until we get them enabled. # If you are enabling a directory, please add directory specific exclusions # below. -image/** layout/** netwerk/cookie/test/browser/** netwerk/test/browser/** diff --git a/.eslintrc.js b/.eslintrc.js index 85ea9edaf271..2da37d8ab09c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -158,8 +158,40 @@ module.exports = { "quotes": "off", "semi": "off", "space-infix-ops": "off", + } + }, { + "files": [ + "image/**", + ], + "rules": { + "mozilla/consistent-if-bracing": "off", + "mozilla/use-chromeutils-generateqi": "off", + "mozilla/use-services": "off", + "no-array-constructor": "off", + "no-implied-eval": "off", + "no-redeclare": "off", + "no-self-assign": "off", + "no-throw-literal": "off", + "no-undef": "off", + "no-unneeded-ternary": "off", + "no-unused-vars": "off", - + // Not enabling the rules below for now pending prettier roll-out. + "brace-style": "off", + "comma-dangle": "off", + "comma-spacing": "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", + "padded-blocks": "off", + "quotes": "off", + "semi": "off", + "space-before-function-paren": "off", + "space-infix-ops": "off", } }] }; diff --git a/image/test/mochitest/animationPolling.js b/image/test/mochitest/animationPolling.js index 6f5e7c889f25..c4ad8c0959e4 100644 --- a/image/test/mochitest/animationPolling.js +++ b/image/test/mochitest/animationPolling.js @@ -229,14 +229,12 @@ AnimationTest.prototype.setupPolledImage = function () this.cleanUpAndFinish(); } - } else { - if (!gIsRefImageLoaded) { + } else if (!gIsRefImageLoaded) { this.myImage = new Image(); this.myImage.onload = reuseImageCallback; document.getElementById(this.imageElementId).setAttribute('src', this.referenceElementId); } - } } AnimationTest.prototype.checkImage = function () diff --git a/image/test/mochitest/test_animation_operators.html b/image/test/mochitest/test_animation_operators.html index 80fc8d35650f..0e4b7c35e1eb 100644 --- a/image/test/mochitest/test_animation_operators.html +++ b/image/test/mochitest/test_animation_operators.html @@ -138,7 +138,7 @@ function startTest(i) testData.op + " " + testData.test + " " + testData.reference); RemoveFinishDependency(); } - var iframe = { element: element, loaded: false }; + var iframe = { element, loaded: false }; return iframe; } diff --git a/image/test/mochitest/test_bug490949.html b/image/test/mochitest/test_bug490949.html index 327a052814a1..1616bd0b8cbf 100644 --- a/image/test/mochitest/test_bug490949.html +++ b/image/test/mochitest/test_bug490949.html @@ -44,7 +44,7 @@ RemoteCanvas.prototype.load = function(cb) { // Here is where the magic happens... add a listener to the // frame's onload event - it will call handleEvent iframe.addEventListener("load", this, true); - //append to the end of the page + // append to the end of the page window.document.body.appendChild(iframe); }; @@ -60,7 +60,7 @@ RemoteCanvas.prototype.handleEvent = function() { // SpecialPowers.snapshotRect method var remoteWindow = ldrFrame.contentWindow; - //Draw canvas + // Draw canvas canvas.style.width = RemoteCanvas.CANVAS_WIDTH + "px"; canvas.style.height = RemoteCanvas.CANVAS_HEIGHT + "px"; canvas.width = RemoteCanvas.CANVAS_WIDTH; diff --git a/image/test/mochitest/test_bug496292.html b/image/test/mochitest/test_bug496292.html index f1ed0df111b4..5f64bf4148c3 100644 --- a/image/test/mochitest/test_bug496292.html +++ b/image/test/mochitest/test_bug496292.html @@ -44,7 +44,7 @@ RemoteCanvas.prototype.load = function(cb) { // Here is where the magic happens... add a listener to the // frame's onload event - it will call handleEvent iframe.addEventListener("load", this, true); - //append to the end of the page + // append to the end of the page window.document.body.appendChild(iframe); }; @@ -60,7 +60,7 @@ RemoteCanvas.prototype.handleEvent = function() { // SpecialPowers.snapshotRect method var remoteWindow = ldrFrame.contentWindow; - //Draw canvas + // Draw canvas canvas.style.width = RemoteCanvas.CANVAS_WIDTH + "px"; canvas.style.height = RemoteCanvas.CANVAS_HEIGHT + "px"; canvas.width = RemoteCanvas.CANVAS_WIDTH; diff --git a/image/test/mochitest/test_net_failedtoprocess.html b/image/test/mochitest/test_net_failedtoprocess.html index 8f0222b098c1..fdf8794dccff 100644 --- a/image/test/mochitest/test_net_failedtoprocess.html +++ b/image/test/mochitest/test_net_failedtoprocess.html @@ -23,14 +23,14 @@ var obs = Cc["@mozilla.org/observer-service;1"].getService(); obs = obs.QueryInterface(Ci.nsIObserverService); var observer = { - QueryInterface: function (aIID) { + QueryInterface (aIID) { if (aIID.equals(Ci.nsISupports) || aIID.equals(Ci.nsIObserver)) return this; throw Cr.NS_ERROR_NO_INTERFACE; }, - observe: function(subject, topic, data) { + observe(subject, topic, data) { ok(topic == "net:failed-to-process-uri-content", "wrong topic"); subject = subject.QueryInterface(Ci.nsIURI); is(subject.asciiSpec, "http://mochi.test:8888/tests/image/test/mochitest/invalid.jpg", "wrong subject"); diff --git a/image/test/unit/async_load_tests.js b/image/test/unit/async_load_tests.js index c2afbd7f5649..843b15e85520 100644 --- a/image/test/unit/async_load_tests.js +++ b/image/test/unit/async_load_tests.js @@ -40,7 +40,7 @@ function checkClone(other_listener, aRequest) do_test_pending(); // For as long as clone notification is synchronous, we can't test the clone state reliably. - var listener = new ImageListener(null, function(foo, bar) { do_test_finished(); } /*getCloneStopCallback(other_listener)*/); + var listener = new ImageListener(null, function(foo, bar) { do_test_finished(); } /* getCloneStopCallback(other_listener)*/); listener.synchronous = false; var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools) .createScriptedObserver(listener); @@ -123,7 +123,7 @@ function getChannelLoadImageStopCallback(streamlistener, next) function checkSecondChannelLoad() { do_test_pending(); - var channel = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true}); + var channel = NetUtil.newChannel({uri, loadUsingSystemPrincipal: true}); var channellistener = new ChannelListener(); channel.asyncOpen(channellistener); @@ -148,7 +148,7 @@ function run_loadImageWithChannel_tests() gCurrentLoader = Cc["@mozilla.org/image/loader;1"].createInstance(Ci.imgILoader); do_test_pending(); - var channel = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true}); + var channel = NetUtil.newChannel({uri, loadUsingSystemPrincipal: true}); var channellistener = new ChannelListener(); channel.asyncOpen(channellistener); diff --git a/image/test/unit/test_encoder_png.js b/image/test/unit/test_encoder_png.js index e552f6298665..1c719c4e5a0c 100644 --- a/image/test/unit/test_encoder_png.js +++ b/image/test/unit/test_encoder_png.js @@ -193,7 +193,7 @@ function makeDataURLFromAsync(encoder, mimetype, expected) { var asyncReader = { - onInputStreamReady: function(stream) + onInputStreamReady(stream) { binarystream.setInputStream(stream); var available = 0; diff --git a/image/test/unit/test_imgtools.js b/image/test/unit/test_imgtools.js index c133df9b4e66..fc854954211c 100644 --- a/image/test/unit/test_imgtools.js +++ b/image/test/unit/test_imgtools.js @@ -646,18 +646,18 @@ var testData = for(var i=0; i