Bug 1245916: Add additional default globals. r=felipe
This defines a few additional globals but also turns on the browser environment
for everything in browser and toolkit. This may lead to some false negatives
but we have lots of code that runs in a browser context so in the name of
getting rules turned on I think this is a useful step.
MozReview-Commit-ID: BdWouZGK6d
--- a/testing/mochitest/browser.eslintrc
+++ b/testing/mochitest/browser.eslintrc
@@ -9,21 +9,26 @@
"browser": true,
},
// All globals made available in the test environment.
"globals": {
"add_task": false,
"Assert": false,
"BrowserTestUtils": false,
+ "content": false,
"ContentTask": false,
+ "ContentTaskUtils": false,
"EventUtils": false,
"executeSoon": false,
+ "expectUncaughtException": false,
"export_assertions": false,
+ "extractJarToTmp": false,
"finish": false,
+ "getJar": false,
"getRootDirectory": false,
"getTestFilePath": false,
"gTestPath": false,
"info": false,
"is": false,
"isnot": false,
"ok": false,
"registerCleanupFunction": false,
@@ -32,15 +37,10 @@
"SpecialPowers": false,
"thisTestLeaksUncaughtRejectionsAndShouldBeFixed": false,
"todo": false,
"todo_is": false,
"todo_isnot": false,
"waitForClipboard": false,
"waitForExplicitFinish": false,
"waitForFocus": false,
- "gBrowser": false,
- "gNavToolbox": false,
- "gURLBar": false,
- "gNavigatorBundle": false,
- "content": false,
}
}
--- a/testing/xpcshell/xpcshell.eslintrc
+++ b/testing/xpcshell/xpcshell.eslintrc
@@ -19,23 +19,28 @@
"do_get_cwd": false,
"do_get_file": false,
"do_get_idle": false,
"do_get_profile": false,
"do_load_module": false,
"do_parse_document": false,
"do_print": false,
"do_register_cleanup": false,
+ "do_report_unexpected_exception": false,
"do_test_finished": false,
"do_test_pending": false,
"do_throw": false,
"do_timeout": false,
"equal": false,
"load": false,
+ "mozinfo": false,
"notDeepEqual": false,
"notEqual": false,
"notStrictEqual": false,
"ok": false,
"run_next_test": false,
"run_test": false,
"strictEqual": false,
+ "todo": false,
+ "todo_check_false": false,
+ "todo_check_true": false,
}
}
--- a/toolkit/.eslintrc
+++ b/toolkit/.eslintrc
@@ -187,10 +187,20 @@
// ++ and -- should not need spacing
// "space-unary-ops": [2, { "words": true, "nonwords": false }],
// No comparisons to NaN
"use-isnan": 2,
// Only check typeof against valid results
"valid-typeof": 2,
+ },
+ "env": {
+ "es6": true,
+ "browser": true,
+ },
+ "globals": {
+ "Components": false,
+ "dump": true,
+ "openDialog": false,
+ "sizeToContent": false,
}
}