diff --git a/.eslintignore b/.eslintignore index 8fde0188f071..02e51ca7655a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -11,11 +11,6 @@ # Exclude expected objdirs. 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. -layout/** - # We currently have no js files in these directories, so we ignore them by # default to aid ESLint's performance. build/** diff --git a/.eslintrc.js b/.eslintrc.js index 36ba19caf35c..509e7d9b5125 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -259,5 +259,83 @@ module.exports = { "space-unary-ops": "off", "spaced-comment": "off", } + }, { + "files": [ + "layout/**", + ], + "rules": { + "object-shorthand": "off", + "mozilla/avoid-removeChild": "off", + "mozilla/consistent-if-bracing": "off", + "mozilla/reject-importGlobalProperties": "off", + "mozilla/no-arbitrary-setTimeout": "off", + "mozilla/no-define-cc-etc": "off", + "mozilla/no-useless-parameters": "off", + "mozilla/no-useless-run-test": "off", + "mozilla/use-chromeutils-generateqi": "off", + "mozilla/use-chromeutils-import": "off", + "mozilla/use-default-preference-values": "off", + "mozilla/use-includes-instead-of-indexOf": "off", + "mozilla/use-services": "off", + "mozilla/use-ownerGlobal": "off", + "complexity": "off", + "consistent-return": "off", + "dot-notation": "off", + "no-array-constructor": "off", + "no-caller": "off", + "no-cond-assign": "off", + "no-extra-boolean-cast": "off", + "no-eval": "off", + "no-else-return": "off", + "no-func-assign": "off", + "no-global-assign": "off", + "no-implied-eval": "off", + "no-lonely-if": "off", + "no-nested-ternary": "off", + "no-new-wrappers": "off", + "no-redeclare": "off", + "no-restricted-globals": "off", + "no-return-await": "off", + "no-sequences": "off", + "no-throw-literal": "off", + "no-useless-concat": "off", + "no-undef": "off", + "no-unreachable": "off", + "no-unsanitized/method": "off", + "no-unsanitized/property": "off", + "no-unsafe-negation": "off", + "no-unused-vars": "off", + "no-useless-return": "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", + "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", + } }] }; diff --git a/layout/base/tests/transformed_scrolling_repaints_3_window.html b/layout/base/tests/transformed_scrolling_repaints_3_window.html index e946a9f2b0a7..1b345a25d082 100644 --- a/layout/base/tests/transformed_scrolling_repaints_3_window.html +++ b/layout/base/tests/transformed_scrolling_repaints_3_window.html @@ -14,7 +14,6 @@ var SimpleTest = window.opener.SimpleTest; var SpecialPowers = window.opener.SpecialPowers; var is = window.opener.is; -var t, e, utils, iterations; var smoothScrollPref = "general.smoothScroll"; function startTest() { diff --git a/layout/forms/test/test_bug536567_perwindowpb.html b/layout/forms/test/test_bug536567_perwindowpb.html index c4ea329b8dd0..dc2088e20c29 100644 --- a/layout/forms/test/test_bug536567_perwindowpb.html +++ b/layout/forms/test/test_bug536567_perwindowpb.html @@ -30,12 +30,12 @@ function newDir() { var dir = tmpDir.clone(); dir.append("testdir" + Math.floor(Math.random() * 10000)); dir.QueryInterface(Ci.nsIFile); - dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0700); + dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o700); return dir; } var dirs = []; -for(var i = 0; i < 6; i++) { +for(let i = 0; i < 6; i++) { dirs.push(newDir()); } dirs.push(homeDir); @@ -119,7 +119,7 @@ function runTest() { } function endTest() { - for(var i = 0; i < dirs.length - 1; i++) { + for(let i = 0; i < dirs.length - 1; i++) { dirs[i].remove(true); } @@ -168,7 +168,7 @@ function testOnWindow(aIsPrivate, aCallback) { MockFilePicker.showCallback = function(filepicker) { var test = tests[testIndex]; var returned = -1; - for (var i = 0; i < dirs.length; i++) { + for (let i = 0; i < dirs.length; i++) { var dir = MockFilePicker.displayDirectory ? MockFilePicker.displayDirectory : Services.dirsvc.get(MockFilePicker.displaySpecialDirectory, Ci.nsIFile); diff --git a/layout/forms/test/test_bug903715.html b/layout/forms/test/test_bug903715.html index 9b9db48b75cf..b887b2cd0144 100644 --- a/layout/forms/test/test_bug903715.html +++ b/layout/forms/test/test_bug903715.html @@ -59,7 +59,7 @@ function runTests() select.addEventListener("popupshowing", function (aEvent) { setTimeout(function () { synthesizeKey("KEY_ArrowDown"); - select.addEventListener("popuphiding", function (aEvent) { + select.addEventListener("popuphiding", function (aEventInner) { setTimeout(function () { // Enter key should cause closing the dropdown of the select element // and keypress event shouldn't be fired on the input element because diff --git a/layout/generic/test/plugin_clipping_lib.js b/layout/generic/test/plugin_clipping_lib.js index 287c1574eadc..ee6deedb9187 100644 --- a/layout/generic/test/plugin_clipping_lib.js +++ b/layout/generic/test/plugin_clipping_lib.js @@ -114,17 +114,17 @@ function checkClipRegionWithDoc(doc, offsetX, offsetY, id, rects, checkBounds) { "': expected " + dumpRegion(rects) + ", got " + dumpRegion(clipRects)); } -checkClipRegion = function checkClipRegion(id, rects) { +checkClipRegion = function(id, rects) { checkClipRegionWithDoc(document, 0, 0, id, rects, true); } -checkClipRegionForFrame = function checkClipRegionForFrame(fid, id, rects) { +checkClipRegionForFrame = function(fid, id, rects) { var f = document.getElementById(fid); var bounds = f.getBoundingClientRect(); checkClipRegionWithDoc(f.contentDocument, bounds.left, bounds.top, id, rects, true); } -checkClipRegionNoBounds = function checkClipRegionNoBounds(id, rects) { +checkClipRegionNoBounds = function(id, rects) { checkClipRegionWithDoc(document, 0, 0, id, rects, false); } diff --git a/layout/generic/test/test_bug1499961.html b/layout/generic/test/test_bug1499961.html index a2f4c0ba1f1c..12b217f39e1f 100644 --- a/layout/generic/test/test_bug1499961.html +++ b/layout/generic/test/test_bug1499961.html @@ -29,6 +29,7 @@ limitations under the License.

         
+  
   
 
 
@@ -60,7 +60,7 @@ var canvasNames = [ "brokenIconTest",  "brokenIconReference",
                     "loadingIconTest", "loadingIconReference",
                     "loadedTest",      "loadedReference" ];
 var windowElem = document.documentElement;
-for (var i in canvasNames) {
+for (let i in canvasNames) {
   var can = document.createElement("canvas");
   can.setAttribute("width", windowElem.getAttribute("width"));
   can.setAttribute("height", windowElem.getAttribute("height"));
@@ -81,7 +81,7 @@ for (var i in canvasNames) {
   // with the image, but not the bottom and right borders.
 
   if ((i > 1) && (i < 4)) {
-    var ctx = can.getContext("2d");
+    let ctx = can.getContext("2d");
     ctx.beginPath();
     ctx.rect(0,0, 30, 30);
     ctx.clip();
@@ -327,7 +327,7 @@ function resetImage() {
 // debugging.
 //
 function makeCanvasesVisible() {
-  for (var i = 0; i < canvasNames.length - 1; i += 2) {
+  for (let i = 0; i < canvasNames.length - 1; i += 2) {
     var title = document.createElement("h3");
     title.innerHTML = canvasNames[i] + ", " + canvasNames[i+1] + ":";
     document.body.appendChild(title);
@@ -359,7 +359,7 @@ function disableBorderAndPad() {
 
 function drawWindowToCanvas(canvasName) {
   var win = testFrameElem.contentWindow;
-  var ctx = canvases[canvasName].getContext("2d");
+  let ctx = canvases[canvasName].getContext("2d");
   // drawWindow always draws one canvas pixel for each CSS pixel in the source
   // window, so scale the drawing to show the zoom (making each canvas pixel be one
   // device pixel instead)
diff --git a/layout/style/test/test_acid3_test46.html b/layout/style/test/test_acid3_test46.html
index 8845feddf4f2..4ec50cfddcea 100644
--- a/layout/style/test/test_acid3_test46.html
+++ b/layout/style/test/test_acid3_test46.html
@@ -23,7 +23,7 @@ extracted from the test framework there and put into Mochitest.
 
 Mozilla Bug 156716