Bug 1383120 - Enable no-arbitrary-setTimeout eslint rule on xpcshell tests, r?Mossop
MozReview-Commit-ID: D7y3uALzVQx
--- 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"
}
};