Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (manual fixes). r=mossop
authorMark Banner <standard8@mozilla.com>
Fri, 19 Oct 2018 08:33:17 +0000
changeset 490494 988056e6d0543949b91fd7501ab4140f88e087e6
parent 490493 edc4ae8f78e2fb02647d7cd85cb19830a17dcd1d
child 490495 1ac84aa579d69572a6569e70b73c1e17d206361e
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmossop
bugs1486741
milestone64.0a1
Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (manual fixes). r=mossop Depends on D8389 Differential Revision: https://phabricator.services.mozilla.com/D8391
devtools/client/shared/test/unit/test_parseDeclarations.js
devtools/client/storage/test/browser_storage_values.js
devtools/client/webconsole/components/Message.js
js/src/builtin/Array.js
js/src/builtin/intl/Collator.js
js/src/builtin/intl/CommonFunctions.js
js/src/builtin/intl/DateTimeFormat.js
js/src/builtin/intl/NumberFormat.js
js/src/shell/ModuleLoader.js
--- a/devtools/client/shared/test/unit/test_parseDeclarations.js
+++ b/devtools/client/shared/test/unit/test_parseDeclarations.js
@@ -398,17 +398,18 @@ const TEST_DATA = [
     input: "/*! walrus: zebra; */",
     expected: [{name: "walrus", value: "zebra", priority: "",
                 offsets: [4, 18], commentOffsets: [0, 21]}],
   },
 
   // Regression test for bug 1287620.
   {
     input: "color: blue \\9 no\\_need",
-    expected: [{name: "color", value: "blue \\9 no_need", priority: "", offsets: [0, 23]}],
+    expected: [{name: "color", value: "blue \\9 no_need",
+                priority: "", offsets: [0, 23]}],
   },
 
   // Regression test for bug 1297890 - don't paste tokens.
   {
     parseComments: true,
     input: "stroke-dasharray: 1/*ThisIsAComment*/2;",
     expected: [{name: "stroke-dasharray", value: "1 2", priority: "", offsets: [0, 39]}],
   },
--- a/devtools/client/storage/test/browser_storage_values.js
+++ b/devtools/client/storage/test/browser_storage_values.js
@@ -41,17 +41,18 @@ const testCases = [
     {name: "c1.1", value: "Bar"},
     {name: "c1.2", value: "Object"},
     {name: "c1.2.foo", value: "Bar"},
   ], true],
   [
     getCookieId("c_encoded", "test1.example.org",
                 "/browser/devtools/client/storage/test/"),
     [
-      {name: "c_encoded", value: encodeURIComponent(JSON.stringify({foo: {foo1: "bar"}}))},
+      {name: "c_encoded",
+       value: encodeURIComponent(JSON.stringify({foo: {foo1: "bar"}}))},
     ],
   ],
   [null, [
     {name: "c_encoded", value: "Object"},
     {name: "c_encoded.foo", value: "Object"},
     {name: "c_encoded.foo.foo1", value: "bar"},
   ], true],
   [["localStorage", "http://test1.example.org"]],
--- a/devtools/client/webconsole/components/Message.js
+++ b/devtools/client/webconsole/components/Message.js
@@ -245,17 +245,18 @@ class Message extends Component {
     }
 
     // Configure the location.
     const location = dom.span({ className: "message-location devtools-monospace" },
       frame ? FrameView({
         frame,
         onClick: onFrameClick,
         showEmptyPathAsHost: true,
-        sourceMapService: serviceContainer ? serviceContainer.sourceMapService : undefined,
+        sourceMapService:
+          serviceContainer ? serviceContainer.sourceMapService : undefined,
       }) : null
     );
 
     let learnMore;
     if (exceptionDocURL) {
       learnMore = dom.a({
         className: "learn-more-link webconsole-learn-more-link",
         title: exceptionDocURL.split("?")[0],
--- a/js/src/builtin/Array.js
+++ b/js/src/builtin/Array.js
@@ -879,17 +879,17 @@ function MakeIteratorWrapper(items, meth
     // This function is not inlined in ArrayFrom, because function default
     // parameters combined with nested functions are currently not optimized
     // correctly.
     return {
         // Use a named function expression instead of a method definition, so
         // we don't create an inferred name for this function at runtime.
         [std_iterator]: function IteratorMethod() {
             return callContentFunction(method, items);
-        }
+        },
     };
 }
 
 // ES2015 22.1.3.27 Array.prototype.toString.
 function ArrayToString() {
     // Steps 1-2.
     var array = ToObject(this);
 
--- a/js/src/builtin/intl/Collator.js
+++ b/js/src/builtin/intl/Collator.js
@@ -220,17 +220,17 @@ var collatorInternalProperties = {
         var locales = this._availableLocales;
         if (locales)
             return locales;
 
         locales = intl_Collator_availableLocales();
         addSpecialMissingLanguageTags(locales);
         return (this._availableLocales = locales);
     },
-    relevantExtensionKeys: ["co", "kn", "kf"]
+    relevantExtensionKeys: ["co", "kn", "kf"],
 };
 
 /**
  * Returns the actual locale used when a collator for |locale| is constructed.
  */
 function collatorActualLocale(locale) {
     assert(typeof locale === "string", "locale should be string");
 
@@ -281,17 +281,17 @@ function collatorSortLocaleData() {
                 // The first element of the collations array must be |null|
                 // per ES2017 Intl, 10.2.3 Internal Slots.
                 return null;
             },
             kn: function() {
                 return "false";
             },
             kf: collatorSortCaseFirstDefault,
-        }
+        },
     };
     /* eslint-enable object-shorthand */
 }
 
 function collatorSearchLocaleData() {
     /* eslint-disable object-shorthand */
     return {
         co: function() {
@@ -308,17 +308,17 @@ function collatorSearchLocaleData() {
                 return null;
             },
             kn: function() {
                 return "false";
             },
             kf: function() {
                 return "false";
             },
-        }
+        },
     };
     /* eslint-enable object-shorthand */
 }
 
 /**
  * Function to be bound and returned by Intl.Collator.prototype.compare.
  *
  * Spec: ECMAScript Internationalization API Specification, 10.3.3.1.
--- a/js/src/builtin/intl/CommonFunctions.js
+++ b/js/src/builtin/intl/CommonFunctions.js
@@ -481,17 +481,17 @@ function parseLanguageTag(locale) {
     //         / "zh-guoyu"             ; is defined by their registration
     //         / "zh-hakka"             ; and all of these are deprecated
     //         / "zh-min"               ; in favor of a more modern
     //         / "zh-min-nan"           ; subtag or sequence of subtags
     //         / "zh-xiang"
     if (hasOwn(localeLowercase, grandfatheredMappings)) {
         return {
             locale: grandfatheredMappings[localeLowercase],
-            grandfathered: true
+            grandfathered: true,
         };
     }
 
     return null;
 
     #undef NONE
     #undef ALPHA
     #undef DIGIT
--- a/js/src/builtin/intl/DateTimeFormat.js
+++ b/js/src/builtin/intl/DateTimeFormat.js
@@ -749,33 +749,33 @@ var dateTimeFormatInternalProperties = {
         var locales = this._availableLocales;
         if (locales)
             return locales;
 
         locales = intl_DateTimeFormat_availableLocales();
         addSpecialMissingLanguageTags(locales);
         return (this._availableLocales = locales);
     },
-    relevantExtensionKeys: ["ca", "nu", "hc"]
+    relevantExtensionKeys: ["ca", "nu", "hc"],
 };
 
 function dateTimeFormatLocaleData() {
     return {
         ca: intl_availableCalendars,
         nu: getNumberingSystems,
         hc: () => {
             return [null, "h11", "h12", "h23", "h24"];
         },
         default: {
             ca: intl_defaultCalendar,
             nu: intl_numberingSystem,
             hc: () => {
                 return null;
-            }
-        }
+            },
+        },
     };
 }
 
 /**
  * Function to be bound and returned by Intl.DateTimeFormat.prototype.format.
  *
  * Spec: ECMAScript Internationalization API Specification, 12.1.5.
  */
@@ -893,17 +893,17 @@ var icuPatternCharToComponent = {
     h: "hour",
     H: "hour",
     k: "hour",
     K: "hour",
     m: "minute",
     s: "second",
     z: "timeZoneName",
     v: "timeZoneName",
-    V: "timeZoneName"
+    V: "timeZoneName",
 };
 
 /**
  * Maps an ICU pattern string to a corresponding set of date-time components
  * and their values, and adds properties for these components to the result
  * object, which will be returned by the resolvedOptions method. For the
  * interpretation of ICU pattern characters, see
  * http://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
--- a/js/src/builtin/intl/NumberFormat.js
+++ b/js/src/builtin/intl/NumberFormat.js
@@ -17,17 +17,17 @@ var numberFormatInternalProperties = {
         var locales = this._availableLocales;
         if (locales)
             return locales;
 
         locales = intl_NumberFormat_availableLocales();
         addSpecialMissingLanguageTags(locales);
         return (this._availableLocales = locales);
     },
-    relevantExtensionKeys: ["nu"]
+    relevantExtensionKeys: ["nu"],
 };
 
 /**
  * Compute an internal properties object from |lazyNumberFormatData|.
  */
 function resolveNumberFormatInternals(lazyNumberFormatData) {
     assert(IsObject(lazyNumberFormatData), "lazy data not an object?");
 
@@ -376,26 +376,26 @@ function getNumberingSystems(locale) {
     // for a locale.
     var defaultNumberingSystem = intl_numberingSystem(locale);
     return [
         defaultNumberingSystem,
         "arab", "arabext", "bali", "beng", "deva",
         "fullwide", "gujr", "guru", "hanidec", "khmr",
         "knda", "laoo", "latn", "limb", "mlym",
         "mong", "mymr", "orya", "tamldec", "telu",
-        "thai", "tibt"
+        "thai", "tibt",
     ];
 }
 
 function numberFormatLocaleData() {
     return {
         nu: getNumberingSystems,
         default: {
             nu: intl_numberingSystem,
-        }
+        },
     };
 }
 
 /**
  * Function to be bound and returned by Intl.NumberFormat.prototype.format.
  *
  * Spec: ECMAScript Internationalization API Specification, 11.1.4.
  */
@@ -478,17 +478,17 @@ function Intl_NumberFormat_resolvedOptio
     // Steps 4-5.
     var result = {
         locale: internals.locale,
         numberingSystem: internals.numberingSystem,
         style: internals.style,
         minimumIntegerDigits: internals.minimumIntegerDigits,
         minimumFractionDigits: internals.minimumFractionDigits,
         maximumFractionDigits: internals.maximumFractionDigits,
-        useGrouping: internals.useGrouping
+        useGrouping: internals.useGrouping,
     };
 
     // currency and currencyDisplay are only present for currency formatters.
     assert(hasOwn("currency", internals) === (internals.style === "currency"),
            "currency is present iff style is 'currency'");
     assert(hasOwn("currencyDisplay", internals) === (internals.style === "currency"),
            "currencyDisplay is present iff style is 'currency'");
 
--- a/js/src/shell/ModuleLoader.js
+++ b/js/src/shell/ModuleLoader.js
@@ -133,17 +133,17 @@ const ReflectLoader = new class {
                     components.length = --n;
                     continue;
                 }
             }
 
             ObjectDefineProperty(components, n++, {
                 __proto__: null,
                 value: part,
-                writable: true, enumerable: true, configurable: true
+                writable: true, enumerable: true, configurable: true,
             });
         }
 
         let normalized = ReflectApply(ArrayPrototypeJoin, components, [pathsep]);
 #ifdef XP_WIN
         normalized = drive + normalized;
 #endif
         return normalized;