From 07db0a7e2bd05a9e4ec7d4e6a18d87c378573ca4 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 21 Jan 2020 17:00:48 +0000 Subject: [PATCH] Bug 1609998 - Enable ESLint for non-third party files in editor/libeditor/tests/browserscope/. r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D60305 --HG-- extra : moz-landing-system : lando --- .eslintignore | 3 -- .../tests/browserscope/test_richtext.html | 4 +-- .../tests/browserscope/test_richtext2.html | 30 +++++++++++-------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.eslintignore b/.eslintignore index 378aa35c0c2e..e92867b78f0c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -137,9 +137,6 @@ dom/workers/test/importScripts_worker_imported3.js dom/workers/test/invalid.js dom/workers/test/threadErrors_worker1.js -# Third-party -editor/libeditor/tests/browserscope/ - # intl/ exclusions intl/locale/ intl/strres/ diff --git a/editor/libeditor/tests/browserscope/test_richtext.html b/editor/libeditor/tests/browserscope/test_richtext.html index 268c134fc420..c07f0a366ad0 100644 --- a/editor/libeditor/tests/browserscope/test_richtext.html +++ b/editor/libeditor/tests/browserscope/test_richtext.html @@ -7,7 +7,7 @@ BrowserScope richtext category tests BrowserScope Richtext Tests - + @@ -27,7 +27,7 @@ function sendScore(results, continueParams) { ok(results.length > 1, "At least one test should have been run"); for (var i = 1; i < results.length; ++i) { var result = results[i]; - [type, command, param, success] = result.split(/[\-=]/); + let [type, command, param, success] = result.split(/[\-=]/); var comp = is; if (isKnownFailure(type, command, param)) { comp = todo_is; diff --git a/editor/libeditor/tests/browserscope/test_richtext2.html b/editor/libeditor/tests/browserscope/test_richtext2.html index c725738dd96e..aa5c8fd1cfe3 100644 --- a/editor/libeditor/tests/browserscope/test_richtext2.html +++ b/editor/libeditor/tests/browserscope/test_richtext2.html @@ -14,7 +14,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u BrowserScope Richtext2 Tests - + @@ -68,10 +68,13 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u ); } + /* eslint-disable-next-line complexity */ function runTest() { initVariables(); initEditorDocs(); + // These are all globals in the js and py files above */ + /* eslint-disable no-undef */ const tests = [ SELECTION_TESTS, APPLY_TESTS, @@ -89,8 +92,9 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u QUERYSTATE_TESTS, QUERYVALUE_TESTS, ]; + /* eslint-enable no-undef */ - for (var i = 0; i < tests.length; ++i) { + for (let i = 0; i < tests.length; ++i) { runTestSuite(tests[i]); } @@ -132,10 +136,10 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u // 'body' (test within a ) if (UPDATE_TEST_RESULTS) { - var newKnownFailures = {value: {}, select: {}}; - for (var i = 0; i < tests.length; ++i) { - var category = tests[i]; - for (var group in results[category.id]) { + let newKnownFailures = {value: {}, select: {}}; + for (let i = 0; i < tests.length; ++i) { + let category = tests[i]; + for (let group in results[category.id]) { switch (group) { // Skip the known properties case "count": @@ -144,7 +148,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u case "time": break; default: - for (var test_id in results[category.id][group]) { + for (let test_id in results[category.id][group]) { switch (test_id) { // Skip the known properties case "count": @@ -152,7 +156,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u case "selscore": break; default: - for (var structure in results[category.id][group][test_id]) { + for (let structure in results[category.id][group][test_id]) { switch (structure) { // Only look at each test structure case "dM": @@ -175,9 +179,9 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u resultContainer.style.display = ""; resultContainer.textContent = JSON.stringify(newKnownFailures); } else { - for (var i = 0; i < tests.length; ++i) { - var category = tests[i]; - for (var group in results[category.id]) { + for (let i = 0; i < tests.length; ++i) { + let category = tests[i]; + for (let group in results[category.id]) { switch (group) { // Skip the known properties case "count": @@ -186,7 +190,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u case "time": break; default: - for (var test_id in results[category.id][group]) { + for (let test_id in results[category.id][group]) { switch (test_id) { // Skip the known properties case "count": @@ -194,7 +198,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u case "selscore": break; default: - for (var structure in results[category.id][group][test_id]) { + for (let structure in results[category.id][group][test_id]) { switch (structure) { // Only look at each test structure case "dM":