Bug 1536645 - Enable some ESLint rules in accessible/tests/browser where they are already enabled in the global configuration. r=surkov
authorMark Banner <standard8@mozilla.com>
Thu, 21 Mar 2019 08:51:28 +0000
changeset 465413 d03df68738c80cce9182ea0113244633a42bca4e
parent 465412 5c681491ba94818cfb06f08ff061c32fe7668960
child 465414 4354c226d3388236c307849644c135f9532f3d4a
push id81054
push usermbanner@mozilla.com
push dateThu, 21 Mar 2019 11:06:53 +0000
treeherderautoland@d03df68738c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1536645
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1536645 - Enable some ESLint rules in accessible/tests/browser where they are already enabled in the global configuration. r=surkov Differential Revision: https://phabricator.services.mozilla.com/D24105
accessible/tests/browser/.eslintrc.js
accessible/tests/browser/e10s/browser_caching_attributes.js
accessible/tests/browser/e10s/browser_caching_value.js
accessible/tests/browser/e10s/browser_treeupdate_textleaf.js
accessible/tests/browser/shared-head.js
--- a/accessible/tests/browser/.eslintrc.js
+++ b/accessible/tests/browser/.eslintrc.js
@@ -1,17 +1,14 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/browser-test"
   ],
-  "globals": {
-    "gBrowser": false
-  },
   "rules": {
     "mozilla/no-aArgs": "error",
     "mozilla/reject-importGlobalProperties": ["error", "everything"],
     "mozilla/var-only-at-top-level": "error",
 
     "block-scoped-var": "error",
     "camelcase": "error",
     "comma-dangle": ["error", "never"],
@@ -26,23 +23,18 @@ module.exports = {
     "new-parens": "error",
     "no-fallthrough": "error",
     "no-multi-str": "error",
     "no-multiple-empty-lines": ["error", {"max": 1}],
     "no-proto": "error",
     "no-return-assign": "error",
     "no-shadow": "error",
     "no-unused-vars": ["error", {"vars": "all", "args": "none"}],
-    "object-shorthand": "off",
     "one-var": ["error", "never"],
     "radix": "error",
     "semi-spacing": ["error", {"before": false, "after": true}],
     "space-in-parens": ["error", "never"],
     "strict": ["error", "global"],
     "yoda": "error",
-    "no-implied-eval": "off",
-    "no-iterator": "off",
-    "no-lone-blocks": "off",
-    "no-new-object": "off",
     "no-undef-init": "error",
     "operator-linebreak": ["error", "after"]
   }
 };
--- a/accessible/tests/browser/e10s/browser_caching_attributes.js
+++ b/accessible/tests/browser/e10s/browser_caching_attributes.js
@@ -41,17 +41,17 @@ const attributesTests = [{
   unexpected: {
     "line-number": "1",
     "explicit-name": "true",
     "container-live": "polite",
     "live": "polite"
   }
 }, {
   desc: "@line-number attribute is present when textbox is focused",
-  action: async function(browser) {
+  async action(browser) {
     await invokeFocus(browser, "textbox");
   },
   waitFor: EVENT_FOCUS,
   expected: Object.assign({}, defaultAttributes, { "line-number": "1" }),
   unexpected: {
     "explicit-name": "true",
     "container-live": "polite",
     "live": "polite"
--- a/accessible/tests/browser/e10s/browser_caching_value.js
+++ b/accessible/tests/browser/e10s/browser_caching_value.js
@@ -20,17 +20,17 @@ loadScripts({ name: "value.js", dir: MOC
  */
 const valueTests = [{
   desc: "Initially value is set to 1st element of select",
   id: "select",
   expected: "1st"
 }, {
   desc: "Value should update to 3rd when 3 is pressed",
   id: "select",
-  action: async function(browser) {
+  async action(browser) {
     await invokeFocus(browser, "select");
     await BrowserTestUtils.synthesizeKey("3", {}, browser);
   },
   waitFor: EVENT_TEXT_VALUE_CHANGE,
   expected: "3rd"
 }, {
   desc: "Initially value is set to @aria-valuenow for slider",
   id: "slider",
@@ -97,17 +97,17 @@ const valueTests = [{
   expected: "50%"
 }, {
   desc: "Initially value corresponds to @value attribute for range",
   id: "range",
   expected: "6"
 }, {
   desc: "Value should change when slider is moved",
   id: "range",
-  action: async function(browser) {
+  async action(browser) {
     await invokeFocus(browser, "range");
     await BrowserTestUtils.synthesizeKey("VK_LEFT", {}, browser);
   },
   waitFor: EVENT_VALUE_CHANGE,
   expected: "5"
 }];
 
 /**
--- a/accessible/tests/browser/e10s/browser_treeupdate_textleaf.js
+++ b/accessible/tests/browser/e10s/browser_treeupdate_textleaf.js
@@ -4,28 +4,28 @@
 
 "use strict";
 
 /* import-globals-from ../../mochitest/role.js */
 loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });
 
 async function removeTextData(browser, accessible, id, role) {
   let tree = {
-    role: role,
+    role,
     children: [ { role: ROLE_TEXT_LEAF, name: "text" } ]
   };
   testAccessibleTree(accessible, tree);
 
   let onReorder = waitForEvent(EVENT_REORDER, id);
   await ContentTask.spawn(browser, id, contentId => {
     content.document.getElementById(contentId).firstChild.textContent = "";
   });
   await onReorder;
 
-  tree = { role: role, children: [] };
+  tree = { role, children: [] };
   testAccessibleTree(accessible, tree);
 }
 
 addAccessibleTask(`
   <p id="p">text</p>
   <pre id="pre">text</pre>`, async function(browser, accDoc) {
   let p = findAccessibleChildByID(accDoc, "p");
   let pre = findAccessibleChildByID(accDoc, "pre");
--- a/accessible/tests/browser/shared-head.js
+++ b/accessible/tests/browser/shared-head.js
@@ -250,17 +250,17 @@ function addAccessibleTask(doc, task) {
         Services.obs.removeObserver(observer, "accessible-event");
       }
     });
 
     let onDocLoad = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, "body");
 
     await BrowserTestUtils.withNewTab({
       gBrowser,
-      url: url
+      url
     }, async function(browser) {
       registerCleanupFunction(() => {
         if (browser) {
           let tab = gBrowser.getTabForBrowser(browser);
           if (tab && !tab.closing && tab.linkedBrowser) {
             gBrowser.removeTab(tab);
           }
         }