Bug 1383120 - Enable no-arbitrary-setTimeout eslint rule on xpcshell tests, r?Mossop draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 24 Jul 2017 15:47:10 -0400
changeset 614566 690c3124746b2742e9939dd33e6e5f67a7d6ca53
parent 614565 a1ae41a438d902346f5abdb4e25f806c0d803f0c
child 638906 c4ef7d6f276720e3ccebf121b3af50595bb3560a
push id70055
push userahalberstadt@mozilla.com
push dateMon, 24 Jul 2017 19:48:05 +0000
reviewersMossop
bugs1383120
milestone56.0a1
Bug 1383120 - Enable no-arbitrary-setTimeout eslint rule on xpcshell tests, r?Mossop MozReview-Commit-ID: D7y3uALzVQx
browser/components/extensions/test/xpcshell/.eslintrc.js
browser/components/translation/test/unit/.eslintrc.js
browser/experiments/test/xpcshell/.eslintrc.js
browser/extensions/formautofill/test/unit/.eslintrc.js
devtools/server/tests/unit/.eslintrc.js
devtools/shared/discovery/tests/unit/.eslintrc.js
dom/indexedDB/test/unit/.eslintrc.js
toolkit/components/extensions/test/xpcshell/.eslintrc.js
toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js
toolkit/components/search/tests/xpcshell/.eslintrc.js
toolkit/components/telemetry/tests/unit/.eslintrc.js
toolkit/components/terminator/tests/xpcshell/.eslintrc.js
toolkit/modules/subprocess/test/xpcshell/.eslintrc.js
toolkit/modules/tests/xpcshell/.eslintrc.js
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
--- a/browser/components/extensions/test/xpcshell/.eslintrc.js
+++ b/browser/components/extensions/test/xpcshell/.eslintrc.js
@@ -2,10 +2,13 @@
 
 module.exports = {
   "extends": "plugin:mozilla/xpcshell-test",
 
   "env": {
     // The tests in this folder are testing based on WebExtensions, so lets
     // just define the webextensions environment here.
     "webextensions": true
+  },
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
   }
 };
--- a/browser/components/translation/test/unit/.eslintrc.js
+++ b/browser/components/translation/test/unit/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
-  ]
+  ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/browser/experiments/test/xpcshell/.eslintrc.js
+++ b/browser/experiments/test/xpcshell/.eslintrc.js
@@ -1,15 +1,16 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
   ],
 
   "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
     "no-unused-vars": ["error", {
       "vars": "all",
       "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$",
       "args": "none"
     }]
   }
 };
--- a/browser/extensions/formautofill/test/unit/.eslintrc.js
+++ b/browser/extensions/formautofill/test/unit/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test",
   ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/devtools/server/tests/unit/.eslintrc.js
+++ b/devtools/server/tests/unit/.eslintrc.js
@@ -1,9 +1,10 @@
 "use strict";
 
 module.exports = {
   // Extend from the common devtools xpcshell eslintrc config.
   "extends": "../../../.eslintrc.xpcshell.js",
   "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
     "no-debugger": 0,
   }
 };
--- a/devtools/shared/discovery/tests/unit/.eslintrc.js
+++ b/devtools/shared/discovery/tests/unit/.eslintrc.js
@@ -1,6 +1,9 @@
 "use strict";
 
 module.exports = {
   // Extend from the shared list of defined globals for mochitests.
-  "extends": "../../../../.eslintrc.xpcshell.js"
-};
\ No newline at end of file
+  "extends": "../../../../.eslintrc.xpcshell.js",
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
+};
--- a/dom/indexedDB/test/unit/.eslintrc.js
+++ b/dom/indexedDB/test/unit/.eslintrc.js
@@ -3,11 +3,12 @@
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test",
   ],
   "plugins": [
     "mozilla"
   ],
   "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
     "no-shadow": "off",
   }
 };
--- a/toolkit/components/extensions/test/xpcshell/.eslintrc.js
+++ b/toolkit/components/extensions/test/xpcshell/.eslintrc.js
@@ -2,10 +2,14 @@
 
 module.exports = {
   "extends": "plugin:mozilla/xpcshell-test",
 
   "env": {
     // The tests in this folder are testing based on WebExtensions, so lets
     // just define the webextensions environment here.
     "webextensions": true
+  },
+
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
   }
 };
--- a/toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js
+++ b/toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
-  ]
+  ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/toolkit/components/search/tests/xpcshell/.eslintrc.js
+++ b/toolkit/components/search/tests/xpcshell/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
-  ]
+  ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/toolkit/components/telemetry/tests/unit/.eslintrc.js
+++ b/toolkit/components/telemetry/tests/unit/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
-  ]
+  ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/toolkit/components/terminator/tests/xpcshell/.eslintrc.js
+++ b/toolkit/components/terminator/tests/xpcshell/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
-  ]
+  ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/toolkit/modules/subprocess/test/xpcshell/.eslintrc.js
+++ b/toolkit/modules/subprocess/test/xpcshell/.eslintrc.js
@@ -1,5 +1,8 @@
 "use strict";
 
 module.exports = {
   "extends": "plugin:mozilla/xpcshell-test",
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/toolkit/modules/tests/xpcshell/.eslintrc.js
+++ b/toolkit/modules/tests/xpcshell/.eslintrc.js
@@ -1,7 +1,10 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/xpcshell-test"
-  ]
+  ],
+  "rules": {
+    "mozilla/no-arbitrary-setTimeout": "off",
+  }
 };
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
@@ -64,11 +64,12 @@ module.exports = {
     // eslint-disable-next-line max-len
     // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/uneval
     "uneval": false
   },
 
   rules: {
     "mozilla/import-headjs-globals": "warn",
     "mozilla/mark-test-function-used": "warn",
+    "mozilla/no-arbitrary-setTimeout": "error",
     "no-shadow": "error"
   }
 };