From 8872900b27ea1538415dbdcc9d8f25ab304c711c Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Fri, 5 Feb 2016 12:12:30 -0800 Subject: [PATCH] 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 --- testing/mochitest/browser.eslintrc | 10 +++++----- testing/xpcshell/xpcshell.eslintrc | 5 +++++ toolkit/.eslintrc | 10 ++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/testing/mochitest/browser.eslintrc b/testing/mochitest/browser.eslintrc index 55e222326fb..1e4744c000a 100644 --- a/testing/mochitest/browser.eslintrc +++ b/testing/mochitest/browser.eslintrc @@ -14,11 +14,16 @@ "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, @@ -37,10 +42,5 @@ "waitForClipboard": false, "waitForExplicitFinish": false, "waitForFocus": false, - "gBrowser": false, - "gNavToolbox": false, - "gURLBar": false, - "gNavigatorBundle": false, - "content": false, } } diff --git a/testing/xpcshell/xpcshell.eslintrc b/testing/xpcshell/xpcshell.eslintrc index d4394fabc4e..3907d94c9aa 100644 --- a/testing/xpcshell/xpcshell.eslintrc +++ b/testing/xpcshell/xpcshell.eslintrc @@ -24,12 +24,14 @@ "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, @@ -37,5 +39,8 @@ "run_next_test": false, "run_test": false, "strictEqual": false, + "todo": false, + "todo_check_false": false, + "todo_check_true": false, } } diff --git a/toolkit/.eslintrc b/toolkit/.eslintrc index 575ab58a424..7d5da475243 100644 --- a/toolkit/.eslintrc +++ b/toolkit/.eslintrc @@ -192,5 +192,15 @@ // Only check typeof against valid results "valid-typeof": 2, + }, + "env": { + "es6": true, + "browser": true, + }, + "globals": { + "Components": false, + "dump": true, + "openDialog": false, + "sizeToContent": false, } }