Bug 1489980 - Editor ESLint for editor/ - Initial setup adding configs for tests. r=masayuki
authorMark Banner <standard8@mozilla.com>
Thu, 13 Sep 2018 07:57:57 +0000
changeset 436125 ea73513d7c25
parent 436124 2c48f0cea901
child 436126 de36f39840c6
push id34630
push usernerli@mozilla.com
push dateThu, 13 Sep 2018 21:58:06 +0000
treeherdermozilla-central@71736f1f0f3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1489980
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1489980 - Editor ESLint for editor/ - Initial setup adding configs for tests. r=masayuki Also block-disables no-multi-spaces for test_resizers_resizing_elements.html Differential Revision: https://phabricator.services.mozilla.com/D5584
editor/composer/test/.eslintrc.js
editor/libeditor/tests/.eslintrc.js
editor/libeditor/tests/test_resizers_resizing_elements.html
editor/spellchecker/tests/.eslintrc.js
new file mode 100644
--- /dev/null
+++ b/editor/composer/test/.eslintrc.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/chrome-test",
+    "plugin:mozilla/mochitest-test",
+  ]
+};
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/tests/.eslintrc.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/browser-test",
+    "plugin:mozilla/mochitest-test",
+  ]
+};
--- a/editor/libeditor/tests/test_resizers_resizing_elements.html
+++ b/editor/libeditor/tests/test_resizers_resizing_elements.html
@@ -113,16 +113,18 @@ SimpleTest.waitForFocus(async function()
     // needlessGrowth means that we change the size of a dimension perpendecular to
     // the mouse movement axis in order to preserve the aspect ratio.
     // reversedGrowth means that we change the size of a dimension in the opposite
     // direction to the mouse movement in order to maintain the aspect ratio.
     const ignoredGrowth = aPreserveRatio ? 0 : 1;
     const needlessGrowth = aPreserveRatio ? 1 : 0;
     const reversedGrowth = aPreserveRatio ? -1 : 1;
 
+    /* eslint-disable no-multi-spaces */
+
     // top resizer
     await testResizer(W/2,   0, -10, -10,   0,  10);
     await testResizer(W/2,   0, -10,   0,   0,   0);
     await testResizer(W/2,   0, -10,  10,   0, -10);
     await testResizer(W/2,   0,   0, -10,   0,  10);
     await testResizer(W/2,   0,   0,   0,   0,   0);
     await testResizer(W/2,   0,   0,  10,   0, -10);
     await testResizer(W/2,   0,  10, -10,   0,  10);
@@ -200,16 +202,18 @@ SimpleTest.waitForFocus(async function()
     await testResizer(  0,   0, -10,   0,  10,  10 * needlessGrowth);
     await testResizer(  0,   0, -10,  10,  10, -10 * reversedGrowth);
     await testResizer(  0,   0,   0, -10,  10 * needlessGrowth,  10);
     await testResizer(  0,   0,   0,   0,   0,   0);
     await testResizer(  0,   0,   0,  10,   0, -10 * ignoredGrowth);
     await testResizer(  0,   0,  10, -10, -10 * reversedGrowth,  10);
     await testResizer(  0,   0,  10,   0, -10 * ignoredGrowth,   0);
     await testResizer(  0,   0,  10,  10, -10, -10);
+
+    /* eslint-enable no-multi-spaces */
   }
 
   const kTests = [
     { description: "Resiziers for <img>",
       innerHTML: "<img id=\"target\" src=\"green.png\">",
       mayPreserveRatio: true,
       isAbsolutePosition: false,
     },
@@ -222,17 +226,17 @@ SimpleTest.waitForFocus(async function()
       innerHTML: "<div id=\"target\" style=\"position: absolute; top: 50px; left: 50px;\">positioned</div>",
       mayPreserveRatio: false,
       isAbsolutePosition: true,
     },
   ];
 
   // Resizers for absolute positioned element and table element are available
   // only when enableAbsolutePositionEditing or enableInlineTableEditing is
-  // enabled for each.  So, let's enable them during testing resizers for 
+  // enabled for each.  So, let's enable them during testing resizers for
   // absolute positioned elements or table elements.
   await SpecialPowers.pushPrefEnv({"set": [["editor.resizing.preserve_ratio", false]]});
   for (const kTest of kTests) {
     document.execCommand("enableAbsolutePositionEditing", false, kTest.isAbsolutePosition);
     await doTest(kTest.description, false, kTest.innerHTML);
   }
   await SpecialPowers.pushPrefEnv({"set": [["editor.resizing.preserve_ratio", true]]});
   for (const kTest of kTests) {
new file mode 100644
--- /dev/null
+++ b/editor/spellchecker/tests/.eslintrc.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/mochitest-test"
+  ]
+};